如何将文本区域数据添加到SQL数据库 [英] how to add text area data to SQL data base

查看:89
本文介绍了如何将文本区域数据添加到SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文本区域内容添加到我的数据库User_Comment列





i want to add text area content to my database User_Comment column


String selQuery = "INSERT INTO MapDataImage VALUES User_Comment WHERE Source='" + TextBox1.Text + "' AND Destination='" + TextBox2.Text + "'";
       {

           SqlCommand scmd = new SqlCommand(selQuery, conn2);

           conn2.Open();
           scmd.Parameters.Add("@User_Comment", content.value);





这里我的查询检查我的文本框输入是否与数据库值匹配...



如果匹配它会将评论数据插入数据库



所以我在数据库中有列User_Comment来存储评论



i有文字区呼叫内容



我如何通过这些值?请有人帮帮我.....................



here my query check if my textbox inputs match with database values...

and if its match it will insert comment data to database

so i have column User_Comment in database to store comments

i have a text area call content

how i pass these values? please someone help me.....................

推荐答案

不能多说因为问题没有描述问题很好,但是通过检查你的代码,似乎content.value应该是content.Value with Capital'V',第二你应该< asp.textbox>< /asp.textbox> 使用 TextMode =MultiLine并访问其 Text 属性以获取值。
Cant say much because question is not describing problem well,However by inspecting your code it seems that content.value should be content.Value with Capital 'V' , Second you should <asp.textbox></asp.textbox> with TextMode="MultiLine" and access its Text property to get value.


这篇关于如何将文本区域数据添加到SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆