且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有关数据库的问题

更新时间:2023-02-27 07:47:38

请确保要在数据库中插入查询的列的大小为sa"MAX"

make sure that the column in the database where you are inserting the query has size sa "MAX"
i.e.
CREATE TABLE [dbo].[tbl_Query](
    [Id] [bigint] NULL,
    [Query] [nvarchar](MAX) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
) ON [PRIMARY]


这个,
txtQuerybox.text = txtQuerybox.text.Replace("''","'");


现在,在您的sql查询中传递"txtQuerybox.text"作为参数以保存/更新数据.

为什么会这样?
您在这样的文本框中有文字


now, pass ''txtQuerybox.text'' as parameter in your sql Query for save/update data.

why this happens?
you have text in textbox like this

student's table ...


这种情况下插入语句的样子


that case how insert statement look like

Insert into tbl(fld1) values('student's table ...')


有3个单引号,请参见带下划线的部分.
sql无法忽略值的结尾位置,因为启动&最终值由单引号&这里有3个单引号
祝您编码愉快!
:)


there are 3 single quotes, see underlined portion.
Sql can''t deside where the value ends, because starting & ending value is mentioned by single quote & here there are 3 single quotes
Happy Coding!
:)