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

Earlier Replies | Replies 2 to 7 of 7 | Later Replies
Goto Page: 1
Monte on Jun 13, 2011 at 2:51:37 PM (# 2)

Bumping this. I'm sure someone has an answer.


MHenke on Jun 14, 2011 at 5:44:38 AM (# 3)

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


Monte on Jun 24, 2011 at 9:45:58 AM (# 4)

I fixed this, by the way.

The problem was that after I did the conn.Open(), I forgot to populate my DataTable:

adapter.Fill(dtaTable);

That seems to have solved the issue.

This is probably inefficient and inelegant, but it works.


jeffmain on Nov 19, 2011 at 12:15:50 AM (# 5)

My Dear,

Our company is a distributor of herbs roots to a United Kingdom client and they have call us to supply Kamzi.H2 Root ,So we are looking for trustworthy and honest partnership for this long term transaction.

I have Purchased the root called Kamzi.H2 Root before in Malaysia at the rate of $200 American dollars per packet of which I sold to my client at the rate of $900 American dollar, its been use to cure Lungs Cancer and Diabetes.

But this time l will not be able to fly over to Malaysia for this business at this time, because of my position at the company now, so if you are interested, I can give you the contact of the seller in Malaysia and connect you with the Buyer who is in need of this root as the main dealer, so you and l can share the profit margin on it as the buyer is ready to fly over to Malaysia for the root at the moment and he's ready to purchase 5000 packets (Five Thousand packets).

I don't want to introduce the seller over there in Malaysia to the UK buyer directly because of the profit margin.


Kindly get back to me for more details if you are interested.get back to me via my personal email address (jeff_main@ymail.com)

Best Regards,
Jeff Mains.


bod1467 on Nov 21, 2011 at 3:26:12 AM (# 6)

My dearest JeffyJeffJeff,

With all due respect (i.e. none), go peddle your SPAM elsewhere. In other words - piss off.


pipipeng on Feb 6, 2012 at 12:33:42 AM (# 7)

NY Escorts Girls, arrange you [url=http://www.nyasiangirls.com]New York Escort[/url] to meet with our professional New York Escort. They come from many [url=http://www.nyasiangirls.com]New York Escorts[/url] different backgrounds. They are happy and fun to be [url=http://www.nyasiangirls.com]New York Asian Escort[/url] accompanying with, let our escorts bring you the total enjoyment of [url=http://www.nyasiangirls.com]New York Asian Escorts[/url] life. Call us now! Let our New York Asian Escort show you how much fun you can get just being in New York.


Earlier Replies | Replies 2 to 7 of 7 | Later 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-2004 InsideDHTML.com, LLC. All rights reserved.