简体   繁体   中英

Urdu values from text field and how can i insert in database?

 string query3 = "INSERT INTO library_database.status_of_issue VALUES('";
                            query3 = query3 + textBox2.Text + "','";
                            query3 = query3 + textBox1.Text + "', CURDATE(),ADDDATE(CURDATE(), INTERVAL 14 DAY))";
                            cmd = new MySqlCommand(query3, con);   

text feild should received urdu text whenever from open . and how can i add urdu value in my database? how can insert urdu text from textfield to in my mysql database. there is some query problem with me how can i write my query?

Can you please provide what the error you are getting ? I suggest you first write the insert statement using your SQL and check . I think the Insert statement should be as

var text1 = query3 + textbox2.Text;
var text2 = query3 + textbox1.Text;

= "INSERT INTO library_database.status_of_issue VALUES('"+text1 +"','"+text2 +"',CURDATE(),ADDDATE(CURDATE(), INTERVAL 14 DAY))";

If this also doesnt work, request you to provide your SQL table schema of "library_database.status_of_issue".

Hope your field in which you are trying to insert the urdu text is of type : nvarchar Then you can also insert as below :

insert into [library_database.status_of_issue] ([fieldname]) values ('N'@urduvalue)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM