Gridview insert/update

J

JasonT80

I have populated a gridview using a LEFT OUTER JOIN query against a calendar
table. This creates dated records on the gridview where no records exist in
the data table. I need my gridview to be able to insert a new record on
update if none exists.

How can I do this?

Thanks!
Jasont80
 
O

offwhite

Are you using a Table Adapter?

An approach I would use would be to bind the update statement to a
stored procedure. In that stored proc you could check if the item
exists and choose to do an insert/update as needed.

Alternatively, I would also consider using a ObjectDataSource which I
find is easier to manage. You tag the class as a DataObject and the
various methods as Select, Insert, Update and Delete methods. In those
methods you can run any ADO.NET routine to do what you gotta do.

You can read more about it here...

http://msdn2.microsoft.com/en-us/library/57hkzhy5.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top