S
Scott D
I am trying to fill datagrid from a stored procedure using the
following code:
Public Sub dgTicketsFill2()
I have removed a of my connString info for posting purposes
Dim connString As String = "server=;uid=;pwd=;Initial
Catalog="
Dim conn As SqlConnection = New SqlConnection(connString)
Dim cmd As SqlCommand = New SqlCommand("~Stored Procedure
Name~", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet
da.Fill(ds, "ViewOpenTickets")
Me.dgOpenTickets.DataSource =
ds.Tables("ViewOpenTickets").DefaultView
Me.dgOpenTickets.DataBind()
End Sub
I receieve the following error:
Object reference not set to an instance of an object.
I can fill this same datagrid with no problems if I use a SELECT
statement directly to fill the dataset.
following code:
Public Sub dgTicketsFill2()
I have removed a of my connString info for posting purposes
Dim connString As String = "server=;uid=;pwd=;Initial
Catalog="
Dim conn As SqlConnection = New SqlConnection(connString)
Dim cmd As SqlCommand = New SqlCommand("~Stored Procedure
Name~", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet
da.Fill(ds, "ViewOpenTickets")
Me.dgOpenTickets.DataSource =
ds.Tables("ViewOpenTickets").DefaultView
Me.dgOpenTickets.DataBind()
End Sub
I receieve the following error:
Object reference not set to an instance of an object.
I can fill this same datagrid with no problems if I use a SELECT
statement directly to fill the dataset.