update
-
in my code i write update query like this string strSqlCmdText; strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text; objClsDllSql.funSqlCmd(strSqlCmdText); but i have error ie input string is not in correct format. pls i want to update query. pls help me urgently. gayatri Gayatri
-
in my code i write update query like this string strSqlCmdText; strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text; objClsDllSql.funSqlCmd(strSqlCmdText); but i have error ie input string is not in correct format. pls i want to update query. pls help me urgently. gayatri Gayatri
strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text; Change to strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text).ToString+" where UserId = '"+txtUserId.Text; Also, I should note that you are wide open to SQL injection attacks with that particular implementation. More about SQL injection attacks[^]
-
strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text; Change to strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text).ToString+" where UserId = '"+txtUserId.Text; Also, I should note that you are wide open to SQL injection attacks with that particular implementation. More about SQL injection attacks[^]
-
:)Hi, Try this one.............. strSqlCmdText = "update tUser1 set Count = Convert.ToInt32 (txtCount.Text.trim().ToString()) where UserId = '"+txtUserId.Text; I think it will run properly............. Nisar Inamdar.
-
in my code i write update query like this string strSqlCmdText; strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text; objClsDllSql.funSqlCmd(strSqlCmdText); but i have error ie input string is not in correct format. pls i want to update query. pls help me urgently. gayatri Gayatri
-
in my code i write update query like this string strSqlCmdText; strSqlCmdText = "update tUser1 set Count = "+Convert.ToInt32(txtCount.Text)+" where UserId = '"+txtUserId.Text; objClsDllSql.funSqlCmd(strSqlCmdText); but i have error ie input string is not in correct format. pls i want to update query. pls help me urgently. gayatri Gayatri
I guess you are missing closing quote for UserID field value, probably a text field. With toString change also try to change WHERE clause from
where UserId = '"+txtUserId.Text
; To
where UserId = '"+txtUserId.Text + "'";
-
1. Please do not use text speak. 2. Please do not use 'urgent' anywhere in your message. It's urgent for most people.
_____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!
Shucks, do you have these "The rules" sitting on the clipboard somewheres :-D
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
I guess you are missing closing quote for UserID field value, probably a text field. With toString change also try to change WHERE clause from
where UserId = '"+txtUserId.Text
; To
where UserId = '"+txtUserId.Text + "'";
You could do so, but you are open to SQL injection attacks. I'd use parameters instead...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus