grouchyfd
asked on
How do I call a stored procedure from my database to run in my form that already has a table adpater on it?
I have VS2005.
I have a form that was created through the datasource wizard, dropping the proper objects onto my form. The form is now connected to my database through the table adapter, bindingsource, and bindingnavigator that it created. This all works fine. Is there a way to use this table adapter to call a stored procedure from my database? I can't seem to get it to work. I really don't want to have to code all the objects on the form if I don't have to, to save time. I'm hoping there is way to use the existing table adpater.
The code I'm trying to use is
dim Com as new SqlClient.SqlCommand
Com.CommandType = CommandType.StoredProcedur e
Com.CommandText = "StoredProcedure"
Thanks
I have a form that was created through the datasource wizard, dropping the proper objects onto my form. The form is now connected to my database through the table adapter, bindingsource, and bindingnavigator that it created. This all works fine. Is there a way to use this table adapter to call a stored procedure from my database? I can't seem to get it to work. I really don't want to have to code all the objects on the form if I don't have to, to save time. I'm hoping there is way to use the existing table adpater.
The code I'm trying to use is
dim Com as new SqlClient.SqlCommand
Com.CommandType = CommandType.StoredProcedur
Com.CommandText = "StoredProcedure"
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Great! :-)
and you have filled your dataset again, TableAdapter1.fill(DataSet 1)?
and you have filled your dataset again, TableAdapter1.fill(DataSet
ASKER
Thank you for helping me through a "Duh" type moment on the tableadapter.fill method.
ASKER
Dim Received as integer
Received = Textbox1.Text
Received = Com.ExecuteScalar
Textbox1.Text = Rec