.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 16th, 2003, 04:40 PM
lauyh lauyh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 5 lauyh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Update DataSaet to MySQL

I get a error message from my .aspx which I try to insert a new record into MySQL with DataSet, MySqlProv.3.0. Anyone know where is the problem?

Error message:
Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.

My coding:

Dim objCon As OleDbConnection
Dim objDataAdapter As OleDbDataAdapter
Dim strDbCon As String
Dim count As Integer

strDbCon = "Provider=MySqlProv.3.0;Data Source=atp;"
objCon = New OleDbConnection(strDbCon)
objDataAdapter = New OleDbDataAdapter("Select * from member", objCon)
Dim objCmdBilder As OleDbCommandBuilder = New OleDbCommandBuilder(objDataAdapter)

Dim objDataSet As DataSet = New DataSet
objDataAdapter.Fill(objDataSet, "member")
Dim objDataRow As DataRow = objDataSet.Tables("member").NewRow()

objDataRow("memberName") = memberName.Text
objDataRow("memberNameC") = memberNameC.Text
objDataRow("languageId") = languageId.SelectedIndex

objDataSet.Tables("member").Rows.Add(objDataRow)
count = objDataAdapter.Update(objDataSet, "member")
If count = 1 Then
msg.Text = "successful!"
Else
msg.Text = "fail"
End If

objCon.Close()


Many thanks!! Have a nice day!

Bella
Comments on this post
Gran Roguismo agrees!

Reply With Quote
  #2  
Old September 17th, 2003, 11:56 AM
Wingman Wingman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Bavaria, Germany
Posts: 140 Wingman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 40 m 41 sec
Reputation Power: 11
Quote:
Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.


ADO.Net makes heavy use of the schema information of your database and i guess your MySQL driver (or mysql itself) doesn't support returning enough information to generate the dynamic INSERT/UPDATE/DELETE statement called/generated by the DataSet.

IMHO you need to generate your sql statements by yourself (if you stick to using MySQL - or try another provider if there's one...) :-/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Update DataSaet to MySQL

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap