using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
myConnection.Open();
string sqlStr = "select * from t003 ";
SqlDataAdapter myDa = new SqlDataAdapter(sqlStr, myConnection);
DataSet myDs = new DataSet();
myDa.Fill(myDs);
string[] arr = new string[myDs.Tables[0].Rows.Count];
for (int i = 0; i < myDs.Tables[0].Rows.Count; i++)
{
arr[i] = myDs.Tables[0].Rows[i][1].ToString();
Response.Write(arr[i]);
}
myDa.Dispose();
myDs.Dispose();
myConnection.Close();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string str = "data source=2**7,1433;User ID=li**2s;pwd=li88;Initial Catalog=lih**2s";
SqlConnection myConnection = new SqlConnection(str);myConnection.Open();
string sqlStr = "select * from t003 ";
SqlDataAdapter myDa = new SqlDataAdapter(sqlStr, myConnection);
DataSet myDs = new DataSet();
myDa.Fill(myDs);
string[] arr = new string[myDs.Tables[0].Rows.Count];
for (int i = 0; i < myDs.Tables[0].Rows.Count; i++)
{
arr[i] = myDs.Tables[0].Rows[i][1].ToString();
Response.Write(arr[i]);
}
myDa.Dispose();
myDs.Dispose();
myConnection.Close();
}
}
}