I am having a problem with my C# datagridview. When I add data into it, it doesnt auto update. And nothing I found online works to update the view for the user during runtime. I've used refresh(), update(), invalidate(). Nothing seems to work. Can anyone help me out with this problem??
USING .NET framework 3.0
SyncMaster170
0
Junior Poster in Training
Recommended Answers
Jump to PostChange sql query to:
insertDatetime = @"UPDATE WaynokaLogger SET Date = @Date WHERE AccountID = '" + newString + "'";
or use parametreized query:
insertDatetime = "UPDATE WaynokaLogger SET Date = @Date WHERE AccountID = @id"; da.UpdateCommand = new SqlCommand(insertDatetime, cs); da.UpdateCommand.Parameters.AddWithValue("@Date", SqlDbType.DateTime).Value = …
Jump to PostIn MS SQL Date is a keyword.
Not sure about MySQL but if it is the same then either:
1) Change your column name to something else.
or
2) Put [] around the column name in you command strings.
E.GUPDATE WaynokaLogger SET [Date] = @Date WHERE AccountID = @id
…
All 7 Replies
Mitja Bonca
557
Nearly a Posting Maven
SyncMaster170
0
Junior Poster in Training
SyncMaster170
0
Junior Poster in Training
Mitja Bonca
557
Nearly a Posting Maven
SyncMaster170
0
Junior Poster in Training
nick.crane
342
Veteran Poster
SyncMaster170
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.