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();
}
}如果正确,那么该如何调用?
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 = "select i_id,i_caption from content";
"seelct i_id,i_caption from content";
=======================================
"select i_id,i_caption from content";