SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Microsoft .NET :

Previous DiscussionNext Discussion
 MySqlDataAdapter.Update() does not insert.
For some reason, MySqlDataAdapter.Update() doesn't do the commit to the database (a MySQL database).

I can do a commit in my MySQL IDE, and get the results, but the .NET code doesn't do the update. Any idea why?

Here's the code:

try
{
dt = makeDataTable();
dt.TableName = "SCORES";

conn.Open();

for(int x = 0; x < 5; x++)
{
ptsAgainst = rndPtsAgainst.Next(2, 56);
ptsFor = rndPtsFor.Next(2, 56);

dr = dt.NewRow();
dr[0] = gvMainList.Rows[x].Cells[0].Text;
dr[1] = ddlWeekNum.SelectedValue.ToString();
dr[2] = ptsFor;
dr[3] = ptsAgainst;

ptsPct = calculatePointsPercent((double)ptsFor, (double)ptsAgainst);

dr[4] = ptsPct;

dt.Rows.Add(dr);
}

ds.Tables.Add(dt);

THIS IS WHERE THE UPDATE OCCURS IN THE CODE, HOWEVER THE COMMIT DOES NOT HAPPEN UNLESS I USE MY IDE.
adapter.Update(ds, "SCORES");
ds.AcceptChanges();
}
catch (Exception ex)
{
lblError.Text = ex.Message.ToString();
}
finally
{
dt.Dispose();
ds.Dispose();
conn.Close();
}

Started By Monte on Jun 2, 2011 at 8:49:38 AM

7 Response(s) | Reply

View All Replies | Goto Page: 1
MHenke on Jun 14, 2011 at 5:44:38 AM

Just a SWAG, but maybe an issue with divergent rights for the IDE-user?


View All Replies | Goto Page: 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2000 InsideDHTML.com, LLC. All rights reserved.