TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dealy
NA
213
0
Update table from DataGridView using stored procedures.
Apr 8 2014 7:18 AM
Hello,
I load data from SQL table in a DataGridView with the following code:
SqlConnection conn;
string connectionString = @"Server=myServer; Initial Catalog=MyDatabase; Integrated Security=True;";
using (conn = new SqlConnection(connectionString))
{
SqlCommand cmd = new SqlCommand("SELECT_ENTRIES", conn);
cmd.CommandType = CommandType.StoredProcedure;
//Fill The DataTable From Command
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
//Set It To Binding Navigator
gridDetailsView.DataSource = dt;
gridDetailsView.Dock = DockStyle.Fill;
}
I've created stored procedures for updating (UPDATE_ENTRIES) and insert new data (INSERT_ENTRIES) to the table in SQL Server.
How can I update the table when the user change row in DataGridView?
Thank you in advance.
Reply
Answers (
6
)
How to create a simple calculator
Mapping Microsoft Excel columns programmatically