Tuesday, July 14, 2009

ASP.Net C#, Datagrid question?

In C#(asp.net) , i have a web form tat has purchase details like PO no, PO date(single-text boxes) and itemdetails like (multiple-Datagrid) , on click of save which is at end of web form, shud save all details into database. before tat all details shud save temporaily(without using database) .


Pls get me as many as code samples which use datagrid in asp.net

ASP.Net C#, Datagrid question?
I presume you're using a DataSet, which is disconnected, so you update the dataset on Save and that will be disconnected. For updating the underlying DB you use a DataAdapter, and run it's Update method. Plenty of examples on http://msdn.microsoft.com





Though I myself update differently with my own component.
Reply:You know we have two kinds of database connection.


Connected and Disconnected.





Connected : This kind of connection connects to db everytime to save,delete or update a record or field.So the speed and performance slows down using this connection type.


Objects needed: SqlConnection,SqlCommand,DataSet,DataGri...





Disconnected:This kind of connection doesn't connect to db for each tiny record,feild changes.


it saves the data when it connects to db into DataAdapter object.When changes occures to data it temporaily saves the changes just to it's data(DataAdapter ,not to db).


You just need to upload it's data to database when needed.


objects needed: SqlConnection,SqlCommand,SqlDataAdapter,...





Also you can search for it at msdn.


If you couldn't find enough resource just email me to send the complete example source to you.


No comments:

Post a Comment