This statement is not working and I think it is due to syntax....I think I am missing a " or something...
strUpdateStatement = "UPDATE Employee_Info SET PayPeriod='" & dropdownlist2.selecteditem.value & "', Hours='" & HourlyRate.Text & "' WHERE Employee_ID=12...
Hi all again,
Here is the code that works:
Dim elements() As String = New String() {"1", "2", "3"}
Dim i As Integer
For i = 0 To ubound(elements)
Me.dropdownlist2.Items.Add(New ListItem(elements(i)))
Next
However, instead of New String()...
Hi all,
I want to populate a drop down list with the integers 1 through 52. Instead of writing out a list item for each item I want to create an array to store the 52 values and then bind them to the dropdownlist. Any ideas on how to code this?
Dim MyCommand2 as new OleDbDataAdapter("select * from timesheet where PayPeriod=" & x & "", MyConn)
Hi all, I figured it out! Just to let you all know the problem was that I had an extra quote around the value X. I did not need this as the value of X was an integer!
5...
Even if I declare X as an integer and make x=12 I get type mismatch errors. But if I replace X in the SQL with 12 it is fine. However if I put payperiod='"&12&"'", I get an error. If I put payperiod=12 it is ok.
Sub Button1_Click(sender As Object, e As EventArgs)
Dim ds As...
The column payperiod is a long datatype in the table. I tried making X a long but received the same error. It is really odd because this works:
Dim MyCommand2 as new OleDbDataAdapter("select * from timesheet where PayPeriod=12", MyConn)
The code above will bring back and display...
Thanks for trying to help. Here is the error; I have X as an integer.
Data type mismatch in criteria expression.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
I have a dropdownbox that I select a number. I assign the value of the box to x. I then want to use x in an sql statement.
Here is the code for the button:
Sub Button1_Click(sender As Object, e As EventArgs)
Dim ds As DataSet =new DataSet()
dim x as string
x=dropdownlist1.selecteditem.value...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.