textarea中的内容通过添加按钮添加到SQL数据库中
我定义了一个 textarea:
<tr bgcolor="#CCCCCC" align="center" valign="bottom">
<td align="right" valign="top" class="style1" >文章内容:</td>
<td width="83%" bgcolor="#FFFFFF" align="left">
<textarea cols="75" rows="6" style="width: 1000px; height: 576px"></textarea>
</td>
</tr>
<tr bgcolor="#abb8d6">
<td colspan="2" width="588" align="center" height="55">
<asp:Button ID="Button1" runat="server" Text="添加" onclick="Button1_Click" Width="55px" />
<asp:Button ID="Button2" runat="server" Text="取消" onclick="Button2_Click" Width="55px" />
</td>
</tr>
现在想通过“添加”按钮将textarea中的内容添加到指定的数据库中,该怎么办?
相关文档:
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。
2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎
放弃使用索引而进行全表扫描,如:
select id from t where num is null
可以在num上设置
默认值0,确保表中num列没有null值,然后这
样查询:
sel ......
在sql语句中添加变量。
declare @local_variable data_type
声明时需要指定变量的类型,
可以使用set和select对变量进行赋值,
在sql语句中就可以使用@local_variable来调用变量
声明中可以提供值,否则声明之后所有变量将初始化为NULL。
例如:declare @id int
&nb ......
在SQL Server 2005 Express 上附加从另外一台电脑Copy过来的数据库后,数据库为“只读”。
解决办法:
打开 SQL Server Configuration Manager, 打开SQL Server SQLEXPRESS 的属性
在内置帐号处,把“网络服务”改成“本地系统”,重新启动SQL Server 2005 Express 后,再附加数据 ......
SQL:Structured Query Language,1974年Boyce和Chamberlin提出.
数据定义 :CREATE,DROP
数据库查询:SELECT
数据操纵 :INSERT,UPDATE,DELETE
数据控制 :GRANT,REVOKE
一.数据的定义和修改:
1.定义基表
CREATE TABLE 表名 (<列名1 类型[NOT NULL][,列名2 类型[NOT NULL]>…[其他参数]);
关于类型:
INTEGE ......
http://www.sql-server-performance.com/tips/clustered_indexes_p1.aspx
As a rule of thumb, every table should have a clustered index. Generally, but not always, the clustered index should be on a column that monotonically increases--such as an identity column, or some other column where the value is ......