PDA

View Full Version : mySQL and DataSet INSERT Has Anyone Succesfull?


manabu
12-02-2003, 04:30 AM
I am experimenting DataSet and mySQL. Mostly it is working but the following code (for example) does not update the mySQL table.

DataRow myDataRow;
myDataRow = myDataSet.Tables["Acc"].NewRow();
myDataRow["AccTime"] = DateTime.Now;
myDataRow["User"] = "Tim";
myDataRow["E-mail"] = "tim@boguscompany.com";
odDA.Update(myDataSet.Tables["Acc"]);

If I was to replace
myDataRow = myDataSet.Tables["Acc"].NewRow();
with
myDataRow = myDataSet.Tables["Acc"].Rows[0];

It works. So long as the row already exists in mySQL table, the update does occur. It looks like the INSERT is something that it does not work. If you have any clue, I would love to know.




Manabu Tokunaga , Half Moon Bay, California
+1 415.309.45?9 surf@culturewave.com
SanMateo@Surfrider.org
Visit: http://www.culturewave.net/surfing

Timbo
12-03-2003, 05:01 AM
Always have trouble with this, seems ODBC falls short of the required funtionality, as the same thing works with ASP.NET SQL Objects

I've worked around by generating the SQL statments on-the-fly and calling with and ODBCCommand, but would be good to see if anyone has had this working

manabu
12-03-2003, 08:42 AM
I have resorted to that same for now as well.

Previous to that, and after posting the message, I have also tried to manually create an Insert command into the CommandBuilder. That did not do anything either... Still investigating...


Manabu Tokunaga , Half Moon Bay, California
+1 415.309.45?9 surf@culturewave.com
SanMateo@Surfrider.org
Visit: http://www.culturewave.net/surfing

Timbo
12-11-2003, 04:33 AM
Please post it here if you do, i'll do the same

such a shame the mySQL, in all it's uberness, doens't have this. could be a droiver issue and the cynic in me see's Bill Gates not wanting to fully support it

Timbo
12-11-2003, 05:47 AM
There is an installation of MyOLEDB at www.mysql.com but I don't think it's supported ATM by DASP

And, from the .NET help, it looks as though SqlCommandBuilder or OleDbCommandBuilder will genrate INSERT, UPDATE and DELETE statements on the fly, as long you specify at least the SELECT statement.

sounds good but i'd like to see it in practise. I'll install it at home and see if it works okay

bruce
12-11-2003, 12:24 PM
Try some .net native provider.

See this kb article, http://kb.discountasp.net/article.aspx?id=10081

[b]quote:Originally posted by Timbo

There is an installation of MyOLEDB at www.mysql.com but I don't think it's supported ATM by DASP

And, from the .NET help, it looks as though SqlCommandBuilder or OleDbCommandBuilder will genrate INSERT, UPDATE and DELETE statements on the fly, as long you specify at least the SELECT statement.

sounds good but i'd like to see it in practise. I'll install it at home and see if it works okay
</blockquote id="quote"></font id="quote">

Timbo
12-14-2003, 02:30 AM
Would DASP be willing to consider installing MyOLEDB on their servers? MySQL fully support it, it allows use of the OleDbCommand object offered by the standard .NET package and can be used in conjunction with the currect ODBC DSN's that have been set up to access our databases currently

These assemblies are all okay, but I'm always put off by the bug list. But then, maybe it's MicroSoft that's weird, being that don't make their bugs that public, i dunno

bruce
12-14-2003, 03:52 AM
We do not intend to do much on mySQL in the foreseable future.

To be honest, we think people should us MS SQL for their webapp rather than MySQL. MS SQL is a much better database server in my opinion.

[b]quote:Originally posted by Timbo

Would DASP be willing to consider installing MyOLEDB on their servers? MySQL fully support it, it allows use of the OleDbCommand object offered by the standard .NET package and can be used in conjunction with the currect ODBC DSN's that have been set up to access our databases currently

These assemblies are all okay, but I'm always put off by the bug list. But then, maybe it's MicroSoft that's weird, being that don't make their bugs that public, i dunno
</blockquote id="quote"></font id="quote">

Timbo
12-17-2003, 02:28 AM
Most Definitely Bruce. All plans I've set up since my mySQL-based one use MS SQL, purely for the enhanced functionality of the SqlCommand objects in .NET

but a lot of people still love mySQL. it's a nice app and, above all, it's half the price of MS SQL (on your hosting plans) for no discernable loss of performance. Free installs of the server are also attractive.

Would be nice to get it working, but it sounds like you're going to discontinue mySQL, so probably not viable to install. oh well :¬(