<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="SQLDataProcess_vb" %>
<html>
<head>
	<script language="vb" runat="server">
	dim N as UseSqlData_vb
	sub OKClick(sender as object,e as EventArgs)
		if SQLSeerver.Text<>"" then
			N = new UseSqlData_vb(SQLSeerver.Text,uid.Text,Password.Text,"StockSQL")
			Dim DS as DataSet =new DataSet()
			dim strComm as string="select * from customers"
			dim tbName as string="Customers"
			dim dL as DataGrid =Ctype(sf,DataGrid)
			DIM F AS object =Session("test")
			dim g as object =Session("test1")
'			N.ControlBind(strComm, tbName,ref f, dL, "DataGrid",true)
			N.DropDownListBind("select * from customers","customers",g,tt,true,"CusName","CusID")
			dim cate as DataTable =N.GetDataTable("select * from customers","Customers",DS)
			if Cate is nothing then
			else
				Session("test")=Cate.DataSet
				sf.DataSource=Cate.DefaultView
				sf.DataBind()
			end if
'			Session("NowDissSql")=NowDissSQL;
'			gData.Visible=false;
'			diss.Visible=true;
'			AllcateBind(Cate);
		else
			err.Text="未输入SQL服务器名称"
		end if
	end sub

	</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>