|
i have a filed saved in sql sever db and its data type is int.
i fetch that field from db using this code and assign it to a variable called 'ValueFromDB'
<br />
Private Sub GetMyIntDataTypeField()<br />
<br />
Dim Get_ MyIntDataTypeField_StrSQL As String<br />
Dim Get_ MyIntDataTypeField_ObjCmd As SqlCommand<br />
<br />
Dim strConn As String = ConfigurationManager.ConnectionStrings("MyConnString").ToString()<br />
<br />
<br />
Dim MyCon As SqlConnection<br />
MyCon = New SqlConnection(strConn)<br />
<br />
Get_ MyIntDataTypeField_StrSQL = "Select MyIntField from MyTable"<br />
<br />
MyCon.Open()<br />
<br />
Get_ MyIntDataTypeField_ObjCmd = New SqlCommand(Get_ MyIntDataTypeField_StrSQL, MyCon)<br />
<br />
ValueFromDB = Get_ MyIntDataTypeField_StrSQL_ObjCmd.ExecuteScalar<br />
<br />
MyCon.Close()<br />
<br />
End Sub<br />
after obtaining this value i need to perform a simple subtraction, like
a = ValueFromDB - 17.
after subtraction i am getting, a = -17.
is this because "ValueFromDB" from DB in string format?
|
|
|
|
|
Meax wrote: after obtaining this value i need to perform a simple subtraction, like
a = ValueFromDB - 17.
after subtraction i am getting, a = -17.
is this because "ValueFromDB" from DB in string format?
I think execute scalar returns the type of object.
Set a break point on the line of code to check. If you must use VB.Net I suggest setting option strict and option explicit to true.
Just cast the result as an integer.
I didn't get any requirements for the signature
|
|
|
|
|
I am using an Ajax ModalPopUp Extender where it shows on a button click. On button click,
it shows the popup modal extender and opens a Windows dialog box with Open Save and Cancel on top.
On click of Open or Save or Cancel, I want to hide the popup modal extender.
How can i achieve this.
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
|
Here is the simple code
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<br />
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
</asp:Timer>
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>
<ContentTemplate>
<asp:Image ID="BannerImage" runat="server" ImageUrl="~/Banners/Banner_1.gif" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Here is the code behind
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
Dim n As Integer = New Random().Next(1, 2)
BannerImage.ImageUrl() = "banners/Banner_" + n.ToString + ".gif"
End Sub
End Class
Its line for line code microsoft ajax video # 24 theirs works mine doent
|
|
|
|
|
learningman wrote: Its line for line code microsoft ajax video # 24 theirs works mine doent
what do you meant does not work? what error(s) do you get? be specific
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
i have 2 banner ads only the 1st one comes up!
|
|
|
|
|
|
Well, it seems you need some *cookies*, would you like milk with that?
Joking aside, you need to read a bit more about cookies. Here is an overview of asp.net cookies[^]
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
hi
i am getting one problem when i am running asp.net 2.0 project it is taking lot of resources at iis. any settings i want to change in web.config. if i want to change which i want to write.
tell me in which scenorious it will take .
Please tell as early as possible.
bye....
|
|
|
|
|
guptha19sept wrote: it is taking lot of resources at iis
what do you mean by that. Be specifc. Is it taken more memory? CPU cycle? and how did you found it is IIS?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
there is a question...
that i ues the Controls - ActiveReport 2.0 to print
but when i use Adobe Reader 9.0 to view, the page is exactly.
there are 24 details on every page.
and when i use Adobe Reader 8.0 to view ,the page is not right.
and there are 26 details on every page.
i don't what shall i do.it make me so comfused..
can somebody help me,
thanks you so much!!!!!!!!
Study...
|
|
|
|
|
I have tried but I don't whether I am right or wrong.
Following is my coding :
Page Load
If Not (Page.IsPostBack) Then
Dim dataSource As DataView
'Retrieve item from cache if anything is not there then we have to add to the cache
dataSource = Cache("CheDataSet")
If dataSource Is Nothing Then
Dim Conn As SqlConnection
Dim Cmd As SqlDataAdapter
'Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("con2"))
Cmd = New SqlDataAdapter("select * from tblcutomer2", myConnection)
Dim ds As New DataSet
Cmd.Fill(ds, "clientadd")
dataSource = New DataView(ds.Tables("clientadd"))
Cache("CheDataSet") = dataSource
CacheMsg.Text = "Dataset was Created directly from the Datebase. Here the Cache was not used but the Cache was Created,so check for the performence next time."
Else
cacheMsg.Text = "Dataset was Retrieved from cache which was created earlier."
End If
ddlcus.DataSource = dataSource
ddlcus.DataTextField = "clientname"
ddlcus.DataValueField = "intcustid"
ddlcus.DataBind()
ddlcus.Items.Insert(0, "-Select-")
End If
-----------------------------------------------------------------------------------
Selected Index event:
---------------------
Dim cmd As New SqlCommand("select intcustid,clientadd as address from tblcutomer2 where intcustid='" & ddlcus.SelectedItem.Value & "' ", myConnection)
myConnection.Open()
Dim myDataReader As SqlDataReader
myDataReader = cmd.ExecuteReader()
While (myDataReader.Read()) = True
txtcusadd.Text = myDataReader("address")
End While
myDataReader.Close()
myConnection.Close()
But it takes more time to display address of the selected customer.Can you plz suggest me to reduce the time
|
|
|
|
|
First: this seems a fellow up post. Please don't start new post. This will not make your issue clear to people.
I have to dig out to find what what your first post, here[^] I found it.
indian22 wrote: But it takes more time to display address of the selected customer
Look, you are trying to load 10000 into drop down. Of course it will take time.
indian22 wrote: Can you plz suggest me to reduce the time
What is the need to show that much data into a drop down. Can you reduce the amount to show. Even if you could load all, imagine scrolling through all that data.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hi,
I'm having a problem with JavaScript.
When I use javascript locally everything works fine.
But on the server it does not even come to JavaScript function?
Is there anyone who faced this problem before?
Regards,
codddy
|
|
|
|
|
Javascripts are client side, not server side code. Of course it will not run on the server.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
hiiiiiiiii is than any alt. method avail in c# for all this doings
i used them in javascript is this possible in c# too
|
|
|
|
|
Here is what I've used;
Me.TextBox1.Text = System.Net.Dns.GetHostEntry(Request.ServerVariables("REMOTE_HOST")).HostName.ToString<br />
Me.TextBox2.Text = Request.UserHostAddress
|
|
|
|
|
thanks but i am a c# lover trying this in c# , can u know how how to obtain browser information in c#/vb too...
thanks again.
|
|
|
|
|
|
your friend is an idiot.
Just use parametrized queries and stored procedures. Grant the account used in your connection only permission to execute the stored procedures. Do not use an owner account.
I didn't get any requirements for the signature
|
|
|
|
|
i told him that one before but he insist me to ask you pals so, and if any encoding or decoding for this perpose can be done why shouldn't you just say ok it can be done
or yes its possible but i dont do this before because what i realy ask is for the existence of methods (its my first and basic priority).
|
|
|
|
|
If your friend knows so much about writing secure web applications, why don't you ask him for some sample code?
I didn't get any requirements for the signature
|
|
|
|
|
i should wait for others opinions
|
|
|
|
|
No, you don't need others opinion. Are you trying to trick others in giving you the source code? Do what ToddHileHoffer suggested.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|