MySQL query working directly but not through .NET connection
am 25.07.2009 21:38:15 von John in PuebloHere's the query:
INSERT INTO
USERS(USER_ID,USER_NAME,USER_SCREENNAME,USER_DESCRIPTION,USE R_FOLLOWERS,USER_IMAGE,USER_FRIENDS,USER_LOCATION,USER_CREAT EDAT)
VALUES('31264066','Justin Wienkers','BabyVegaz','Im your secondhand
news/yeah. That and an (aspiring) screenwriter, trained journalist,
blogger, and sometime (Answer B!tch) podcast
co-host.',207,'http://s3.amazonaws.com/twitter_production/pr ofile_images/139858445/2401_560553579174_20308516_34658042_5 292221_n_normal.jpg',160,'Hollywood,
CA',str_to_date('Tue Apr 14 23:29:15 +0000 2009','%a %b %e %H:%i:%s
+0000 %Y'));
It works when I input it directly through the query browser, but not
through my VB.NET code.
Dim sbInsert As New StringBuilder("INSERT INTO
USERS(USER_ID,USER_NAME,USER_SCREENNAME,USER_DESCRIPTION,USE R_FOLLOWERS,USER_IMAGE,USER_FRIENDS,USER_LOCATION,USER_CREAT EDAT)
VALUES(")
sbInsert.Append("'" & frnd.ID & "',")
sbInsert.Append("'" & frnd.name & "',")
sbInsert.Append("'" & frnd.screenname & "',")
'strReplaceString = frnd.description.Replace("'", "\'")
'Debug.Print(Asc())
'strReplaceString = strReplaceString.Replace("""", "'")
'strReplaceString = strReplaceString.Replace(Chr(147), "\'")
'strReplaceString = strReplaceString.Replace(Chr(148), "\'")
strReplaceString = frnd.description
strReplaceString = strReplaceString.Replace("'", "")
strReplaceString = strReplaceString.Replace("""", "")
strReplaceString = strReplaceString.Replace(Chr(147), "")
strReplaceString = strReplaceString.Replace(Chr(148), "")
sbInsert.Append("'" & strReplaceString & "',")
sbInsert.Append(frnd.followers & ",")
sbInsert.Append("'" & frnd.profimage & "',")
sbInsert.Append(frnd.friends & ",")
sbInsert.Append("'" & frnd.location & "',")
sbInsert.Append("str_to_date('" & frnd.createdate & "','%a %b %e
%H:%i:%s +0000 %Y'));")
Clipboard.SetText(sbInsert.ToString())
Dim myInsertNewUser As New MySqlClient.MySqlCommand(sbInsert.ToString,
myTweetConn)
myInsertNewUser.ExecuteNonQuery()
Keep in mind that I have other queries that are working just fine.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org