Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Kent Hamilton   on Jun 07 In Asp.net Category.

  
Question Answered By: Tyrone Sanchez   on Jun 07

do u mean smth like this?

in the initcomp (but this could be all done automatic if you are using VS.NET)


Private sub initializecomponent()
me.sqlConnection = new system.data.sqlclient.SqlConnection
me.sqlDataAdapter = new system.data.sqlclient.SqlDataAdapter
me.sqlCommand = new system.data.sqlclient.SqlCommand

SqlConnection.connectionString = " your connection string "

Me.SqlDataAdapter.InsertCommand = Me.SqLInsertCommand
Me.SqlDataAdapter.SelectCommand = me.SqlSelectCommand

me.SqlSelectCommand.CommandText = "[name of stored procedure]"
me.SqlSelectCommand.CommandType = System.DAta.CommandType.Storedprocedure
sqlDataAdapter.SelectCommand.Connection = SqlConnection

"Take a look after the property TableMappings.addRange

me.SqlSelectCommand.Tablemappings.addRange = "..................." => specific in your case... look after it on msdn.microsoft.com

...


end sub

=> as said, all this before could be done automaticly in Visual Studio.Net (by draging a dataadapter on the design field...)

later when u wanna use de connection...

SqlDataAdapter.Fill(myDataSet) ' dataset  has been filled automaticly ==> it take automaticly your select-command
==> when u wanna up smth => sqlDataAdapter.update(myDataSet) => automaticly takes insert, delete and update...


dataGrid.DataSource = myDataSet
dataGrid.DataMember = myDataSet
DataGrid.DataBind()



Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Taking Values from Storeprocedure into DataSet Or get search suggestion and latest updates.


Tagged: