<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="SQLDataProcess" %>
<html>
<head>
	<script language="C#" runat="server">
	UseSqlData N=null;
	void Page_load(object sender,EventArgs e){
	}
	void OKClick(object sender,EventArgs e){
		string ConnectString="server=localhost;uid=sa;pwd=;database=StockSQL";
		SqlConnection Source=new SqlConnection(ConnectString);
		if(SQLSeerver.Text!=""){
			N = new UseSqlData(SQLSeerver.Text,uid.Text,Password.Text,"StockSQL");
			DataSet DS=new DataSet();
			string strComm="select * from customers";
			string tbName="Customers";
			DataGrid dL=(DataGrid)sf;
			object f=Session["test"];
			object g=Session["test1"];
//			N.ControlBind(strComm, tbName,ref f, dL, "DataGrid",true);
			N.DropDownListBind("select * from customers","customers",ref g,ref tt,true,"CusName","CusID");
			DataTable Cate =N.GetDataTable("select * from customers","Customers",ref DS);
			if(Cate!=null){
				Session["test"]=Cate.DataSet;
				sf.DataSource=Cate.DefaultView;
				sf.DataBind();
			}
//			Session["NowDissSql"]=NowDissSQL;
//			gData.Visible=false;
//			diss.Visible=true;
//			AllcateBind(Cate);
		}
		else{
			err.Text="未输入SQL服务器名称";
		}
	}
	</script>
</head>
<body background="/aspnetdata/images/winback.gif">
<form runat="server">
<asp:panel id="gData" runat="server" >
SQL服务器名称：<ASP:TEXTBOX Text="Localhost" runat="server" id="SQLSeerver" /><br>
登录ID：<ASP:TEXTBOX Text="sa" runat="server" id="uid" /><br>
密码：<ASP:TEXTBOX Runat="server" TextMode="Password" id="Password" /><ASP:button Text="OK" Runat="server" onclick="OKClick" /><br>
<asp:Label id="err" runat="server" />
<asp:dropdownlist id="tt" runat="server" />
</asp:panel>
      <ASP:DataGrid id="sf" runat="server"
        BorderColor="black"
        BorderWidth="1"
        GridLines="Both"
        CellPadding="3"
        CellSpacing="0"
        Font-Name="Verdana"
        Font-Size="9pt"
        HeaderStyle-BackColor="Yellow"
	SelectedItemStyle-BackColor="#FFFFC0"
	aUTOgENERATEcOLUMNS="true"
>

</ASP:DataGrid>
<asp:label id="rr" runat="server" />
</form>
</body>