Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP.Net dataset problem
Message
From
01/03/2002 14:57:51
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
General information
Forum:
ASP.NET
Category:
Other
Title:
ASP.Net dataset problem
Miscellaneous
Thread ID:
00627160
Message ID:
00627160
Views:
40
I am having a problem with a aspx page I am created. Basically, the page accepts parameters through the URL. I am using the querystring to create a collection of the parameters, calling a stored and trying to fill a dataset which is where I get an error message. The error message is Object must implement IConvertible. Another interesting thing, when I debug the program the value of the parameter is (System.Array}. When I drill down on the array in the watch it says under the name column (&H0) and the value is "4321".

Here is the code:
Shared dsJobTicket As New DataSet()
Shared ticketNum(), CustomerName() As String
...
Private Function connect(ByVal constr As String) As Integer
sqlConnect.ConnectionString = constr
Try
sqlConnect.Open()
Catch exp As Exception
lblMessage.Text = exp.Message
Finally
connect = sqlConnect.State
End Try
End Function

Private Sub disconnect()
sqlConnect.Close()

End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim coll As System.Collections.Specialized.NameValueCollection
' Load Form variables into NameValueCollection variable.
coll = Request.QueryString
' Get names of all keys into a string array.
ticketNum = coll.GetValues("ticketnumber")
CustomerName = coll.GetValues("customer")
lblJobTicket.Text = "Job Ticket: " + ticketNum(0)
lblCustomer.Text = "Customer Name: " + CustomerName(0)
daJobTicket.SelectCommand.CommandText = "getJobticket"
daJobTicket.SelectCommand.Connection = sqlConnect
daJobTicket.SelectCommand.Parameters("@jobticket").Value = ticketNum

If connect("data source=(local);initial catalog=segerdahl;persist security info=False;user id=sa;workstation id=(local);packet size=4096") = 1 Then
Try
daJobTicket.Fill(dsJobTicket, "Jobs")
Catch exp As Exception
lblMessage.Text = exp.Message
End Try
If dsJobTicket.Tables.Count > 0 Then
Me.TextBox1.Text = dsJobTicket.Tables(0).Rows(0).Item("printing")
End If
Else
lblCustomer.Text = "Could not connect to database."
End If
disconnect()
End Sub
Thanks

Jim
Reply
Map
View

Click here to load this message in the networking platform