Showing posts with label vs2005. Show all posts
Showing posts with label vs2005. Show all posts

Wednesday, March 21, 2012

Got the same problem

Hello.
I use VS2005 and I was trying to make a little program able to connect to a MySQL 5.0.18 database through MyODBC 3.51.12. I can connect to the database and I can load a table in the Datagridview control, but I can't update the table: the wizard didn't generate the Update method. Even if I configure again the tableAdapter, the wizard generates only:
SELECT statement
table mappings
Fill method
Get method
The table is a very simple table: it has 3 columns and the first is a primary key.

If I create an identical table using Access database and make a program that connects through ODBC, I don't have the problem: the wizard generates also the UPDATE, INSERT and DELETE statements.

Where is the difference? What is the problem?

Thankyou so much for the help

Anthony R.

The MyODBC Driver could not generate the UPDATE command. But the MySQLDirect .NET Data Provider for example generates without problems.

Can anybody help?

|||

I am having a huckuva time trying to get this to work as well. If someone else has any ideas, I would love to hear it.

However, I am working on a project that may work. I do not know if I can get to it soon, so I thought I would post the idea to see if someone else tried it -- to see if I am barking up the wrong tree.

I am using VS2005, MySQL 5, and MyODBC 3.51

I am viewing a TableAdapter in the DataSet Designer. I right-click on the TableAdapter and select Properties. Within the properties are the InsertCommand, DeleteCommand, and UpdateCopmmand methods. They are blank, of course, because as we have noticed, they can't automatically generate.

However, by expanding one of the commands (UpdateCommand, for example) we have access to the CommandText, where we can define the MySQL Command needed to update the table. We also have access to the Parameters, where we define the parameters we will pass.

If I get the chance, I will attempt to try this. If anyone else beats me to it, please let me know if it works.

|||

Someone in the Visual Basic General forum may be able to provide some insights as to why these particular drivers are not generating UPDATE commands.

To follow up on mking's theory, there is some good basic info on the TableAdapter class at: http://msdn2.microsoft.com/en-us/library/bz9tthwx.aspx with lots of good links (including http://msdn2.microsoft.com/en-us/library/dex7k4dw.aspx, which walks through the TableAdapter Configuration Wizard). This information should hopefully provide you with enough information to follow up on MKing's idea and generate the appropriate UPDATE statements.

For additional help with the TableAdapter Configuration Wizard, I'd recommend the Visual Basic General forum at http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=32&SiteID=1. The ADO.NET forum might also be able to provide some assistance: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=45&SiteID=1.

Good luck,

Jason

|||Jason,

Thanks for the tips. However, after some intense drinking, I figured it out. Then I wrote a tutorial about it, which everyone can find on VBMySQl.com.

Got the same problem

Hello.
I use VS2005 and I was trying to make a little program able to connect to a MySQL 5.0.18 database through MyODBC 3.51.12. I can connect to the database and I can load a table in the Datagridview control, but I can't update the table: the wizard didn't generate the Update method. Even if I configure again the tableAdapter, the wizard generates only:
SELECT statement
table mappings
Fill method
Get method
The table is a very simple table: it has 3 columns and the first is a primary key.

If I create an identical table using Access database and make a program that connects through ODBC, I don't have the problem: the wizard generates also the UPDATE, INSERT and DELETE statements.

Where is the difference? What is the problem?

Thankyou so much for the help

Anthony R.

The MyODBC Driver could not generate the UPDATE command. But the MySQLDirect .NET Data Provider for example generates without problems.

Can anybody help?

|||

I am having a huckuva time trying to get this to work as well. If someone else has any ideas, I would love to hear it.

However, I am working on a project that may work. I do not know if I can get to it soon, so I thought I would post the idea to see if someone else tried it -- to see if I am barking up the wrong tree.

I am using VS2005, MySQL 5, and MyODBC 3.51

I am viewing a TableAdapter in the DataSet Designer. I right-click on the TableAdapter and select Properties. Within the properties are the InsertCommand, DeleteCommand, and UpdateCopmmand methods. They are blank, of course, because as we have noticed, they can't automatically generate.

However, by expanding one of the commands (UpdateCommand, for example) we have access to the CommandText, where we can define the MySQL Command needed to update the table. We also have access to the Parameters, where we define the parameters we will pass.

If I get the chance, I will attempt to try this. If anyone else beats me to it, please let me know if it works.

|||

Someone in the Visual Basic General forum may be able to provide some insights as to why these particular drivers are not generating UPDATE commands.

To follow up on mking's theory, there is some good basic info on the TableAdapter class at: http://msdn2.microsoft.com/en-us/library/bz9tthwx.aspx with lots of good links (including http://msdn2.microsoft.com/en-us/library/dex7k4dw.aspx, which walks through the TableAdapter Configuration Wizard). This information should hopefully provide you with enough information to follow up on MKing's idea and generate the appropriate UPDATE statements.

For additional help with the TableAdapter Configuration Wizard, I'd recommend the Visual Basic General forum at http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=32&SiteID=1. The ADO.NET forum might also be able to provide some assistance: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=45&SiteID=1.

Good luck,

Jason

|||Jason,

Thanks for the tips. However, after some intense drinking, I figured it out. Then I wrote a tutorial about it, which everyone can find on VBMySQl.com.

Monday, March 12, 2012

Good SQL Server Site?

I've been working with FirebirdSQL and Delphi for some years now. Most
of our new projects will be VS2005 and SQLServer 2000/2005. Can anyone
recommend a good site for learning SQL Server SP language?
For instance, how do I refer to a new row/field inserted or updated in
an after insert/update trigger? In FirebirdSQL it would be
"New.FieldName".
Thanks,
Warm Regards,
Lee
"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."
this is pretty good
http://www.informit.com/guides/conte...rver&seqNum=46
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lee" <luv2program2000@.yahoo.com> wrote in message
news:uFmuO5dEGHA.3200@.tk2msftngp13.phx.gbl...
>
> I've been working with FirebirdSQL and Delphi for some years now. Most
> of our new projects will be VS2005 and SQLServer 2000/2005. Can anyone
> recommend a good site for learning SQL Server SP language?
> For instance, how do I refer to a new row/field inserted or updated in
> an after insert/update trigger? In FirebirdSQL it would be
> "New.FieldName".
> Thanks,
> --
> Warm Regards,
> Lee
> "Upon further investigation it appears that your software is missing
> just one thing. It definitely needs more cow bell..."

Good SQL Server Site?

I've been working with FirebirdSQL and Delphi for some years now. Most
of our new projects will be VS2005 and SQLServer 2000/2005. Can anyone
recommend a good site for learning SQL Server SP language?
For instance, how do I refer to a new row/field inserted or updated in
an after insert/update trigger? In FirebirdSQL it would be
"New.FieldName".
Thanks,
--
Warm Regards,
Lee
"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."this is pretty good
http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=46
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lee" <luv2program2000@.yahoo.com> wrote in message
news:uFmuO5dEGHA.3200@.tk2msftngp13.phx.gbl...
>
> I've been working with FirebirdSQL and Delphi for some years now. Most
> of our new projects will be VS2005 and SQLServer 2000/2005. Can anyone
> recommend a good site for learning SQL Server SP language?
> For instance, how do I refer to a new row/field inserted or updated in
> an after insert/update trigger? In FirebirdSQL it would be
> "New.FieldName".
> Thanks,
> --
> Warm Regards,
> Lee
> "Upon further investigation it appears that your software is missing
> just one thing. It definitely needs more cow bell..."

Good SQL Server Site?

I've been working with FirebirdSQL and Delphi for some years now. Most
of our new projects will be VS2005 and SQLServer 2000/2005. Can anyone
recommend a good site for learning SQL Server SP language?
For instance, how do I refer to a new row/field inserted or updated in
an after insert/update trigger? In FirebirdSQL it would be
"New.FieldName".
Thanks,
Warm Regards,
Lee
"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."this is pretty good
http://www.informit.com/guides/cont...erver&seqNum=46
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Lee" <luv2program2000@.yahoo.com> wrote in message
news:uFmuO5dEGHA.3200@.tk2msftngp13.phx.gbl...
>
> I've been working with FirebirdSQL and Delphi for some years now. Most
> of our new projects will be VS2005 and SQLServer 2000/2005. Can anyone
> recommend a good site for learning SQL Server SP language?
> For instance, how do I refer to a new row/field inserted or updated in
> an after insert/update trigger? In FirebirdSQL it would be
> "New.FieldName".
> Thanks,
> --
> Warm Regards,
> Lee
> "Upon further investigation it appears that your software is missing
> just one thing. It definitely needs more cow bell..."