读书人

请教这份文件正确吗?(.cs)

发布时间: 2012-04-12 15:46:35 作者: rapoo

请问这份文件正确吗?(.cs)
using System;
using System.Data;
using System.Data.SqlClient;

public class ztx
{
void page_Load()
{
string strConnection = " ";
strConnection = "server=127.0.0.1; ";
strConnection += "database=ztx;uid=sa;password=wxj; ";
string strSql = "seelct i_id,i_caption from content ";
SqlConnection sqlConnection2 = new SqlConnection(strConnection);
SqlCommand sqlCommand2 = new SqlCommand(strSql, sqlConnection2);

zhangtianxing.DataSource = sqlCommand2.ExecuteReader(CommandBehavior.CloseConnection);
zhangtianxing.DataBind();
}
}

如果正确,那么该如何调用?

[解决办法]
string strSql = "seelct i_id,i_caption from content ";改成:
string strSql = "select i_id,i_caption from content ";
[解决办法]
??
ls的想说什么
[解决办法]
lz的意思是什么哦?
[解决办法]
up

读书人网 >C#

热点推荐