欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

mssql脫庫腳本aspx版本-創(chuàng)新互聯(lián)

<%@ Page Language=”C#” %>
 
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
 
<script runat=”server”>
 
protected void Button1_Click(object sender, EventArgs e)
{
string serverIP=txtServerIP.Text;
string database=txtDatabase.Text;
string user=txtUser.Text;
string pass=txtPass.Text;
string tableName=txtTableName.Text;
string colName=txtColName.Text;
string fileName=txtFileName.Text;
 
if (serverIP != null & database != null & user != null & pass != null & tableName != null & fileName != null)
{
 
string connectionString = “server=”+serverIP+”;database=”+database+”;uid=”+user+”;pwd=”+pass;
System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString);
 
try
{
 
connection.Open();
string sqlStr = “select * from “+tableName;
 
if (colName!=”")
{
 
sqlStr = “select ” + colName + ” from ” + tableName;
 
}
 
System.Data.DataSet ds = new System.Data.DataSet();
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(sqlStr, connection);
System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(cmd);
da.Fill(ds);
System.Data.DataTable dataTable = ds.Tables[0];
 
if (dataTable.Rows.Count==0)
{
lblInfo.Text = “沒有需要導(dǎo)出的數(shù)據(jù)!”;
lblInfo.ForeColor = System.Drawing.Color.Blue;
return;
 
}
string filePath = System.IO.Path.GetDirectoryName(Server.MapPath(“DataOutExl.aspx”))+”\DataOut”;
if (!System.IO.Directory.Exists(filePath))
{
System.IO.Directory.CreateDirectory(filePath);
}
bool outType = RadioButton1.Checked;
int sum = dataTable.Rows.Count;
int count = 1;
int size = 0;
int tmpNum = 1;
 
if (txtNum.Text!=”")
{
size = int.Parse(txtNum.Text);
count = sum / size+1;
}
for (int z = 0; z < count; z++)
{
 
Button1.Text = “正在導(dǎo)出..”;
Button1.Enabled = false;
lblInfo.Text = “正在導(dǎo)出第”+(z+1)+”組數(shù)據(jù),共”+count+”組數(shù)據(jù)”;
lblInfo.ForeColor = System.Drawing.Color.Blue;
 
System.IO.StreamWriter file = new System.IO.StreamWriter(filePath+”\” + (z+1) +”_”+fileName, false, Encoding.UTF8);
 
bool isFirst = true;
if (outType)
{
 
file.Write(@”<html><head><meta http-equiv=content-type content=’text/html; charset=UNICODE’>
<style>*{font-size:12px;}table{background:#DDD;border:solid 2px #CCC;}td{background:#FFF;}
.th td{background:#EEE;font-weight:bold;height:28px;color:#008;}
div{border:solid 1px #DDD;background:#FFF;padding:3px;color:#00B;}</style>
<title>Export Table</title></head><body>”);
 
file.Write(“<table border=’0′ cellspacing=’1′ cellpadding=’3′>”);
 
}
 
for (int i = size*z; i < dataTable.Rows.Count; i++)
{
System.Data.DataRow dataRow = dataTable.Rows[i];
if (isFirst)
{
if ( outType)
{
file.Write(“<tr class=’th’>”);
}
 
for (int j = 0; j < dataTable.Columns.Count; j++)
{
 
if (outType)
{
file.Write(“<td>”);
}
 
file.Write(dataTable.Columns[j].ColumnName + “     “);
 
if (outType)
{
file.Write(“</td>”);
}
}
 
if (outType)
{
file.Write(“</tr>”);
}
 
isFirst = false;
}
 
if (outType)
{
file.Write(“<tr>”);
}
else
{
file.WriteLine(” “);
}
 
for (int k = 0; k < dataTable.Columns.Count; k++)
{
 
if (outType)
{
file.Write(“<td>”);
}
 
file.Write(dataTable.Rows[i][k] + “     “);
 
if (outType)
{
file.Write(“</td>”);
}
}
 
if (outType)
{
file.Write(“<tr>”);
}
else
{
file.WriteLine(” “);
}
 
if (tmpNum==size)
break;
 
tmpNum += 1;
 
}
 
if (outType)
{
file.Write(“</table>”);
file.Write(“<br /><div>執(zhí)行成功!返回” + tmpNum + “行</div>”);
file.Write(“</body></html>”);
}
else
{
file.WriteLine(“執(zhí)行成功!返回” + tmpNum + “行!”);
}
 
file.Dispose();
file.Close();
tmpNum = 1;
}
 
lblInfo.Text = “導(dǎo)出成功!”;
lblInfo.ForeColor = System.Drawing.Color.Blue;
Button1.Enabled = true;
Button1.Text = “開始導(dǎo)出”;
 
}
catch (Exception ex)
{
lblInfo.Text = “導(dǎo)出失敗!” + ex.Message;
lblInfo.ForeColor = System.Drawing.Color.Red;
 
}finally
{
connection.Close();
}
 
}
else
{
lblInfo.Text = “請先填寫相關(guān)的連接信息!”;
lblInfo.ForeColor = System.Drawing.Color.Red;
}
}
</script>
 
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head runat=”server”>
<title>無標(biāo)題頁</title>
<style type=”text/css”>
.style1
{
width: 61%;
}
.style2
{
height: 23px;
}
</style>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
 
<table>
<tr>
<td colspan=”2″ align=center>
SQL Server 數(shù)據(jù)導(dǎo) 出&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
By:<a href=”http://hi.baidu.com/閃電小子_tysan”>閃電小子</a></td>
 
</tr>
<tr>
<td>
服務(wù)器IP:</td>
<td>
<asp:TextBox ID=”txtServerIP” runat=”server” Width=”172px”></asp:TextBox>
*</td>
</tr>
<tr>
<td>
數(shù)據(jù)庫:</td>
<td>
<asp:TextBox ID=”txtDatabase” runat=”server” Width=”172px”></asp:TextBox>
*</td>
</tr>
<tr>
<td>
用戶名:</td>
<td>
<asp:TextBox ID=”txtUser” runat=”server” Width=”172px”></asp:TextBox>
*</td>
</tr>
<tr>
<td>
密碼:</td>
<td>
<asp:TextBox ID=”txtPass” runat=”server” Width=”172px”></asp:TextBox>
*</td>
</tr>
<tr>
<td>
表名:</td>
<td>
<asp:TextBox ID=”txtTableName” runat=”server” Width=”172px”></asp:TextBox>
*</td>
</tr>
<tr>
<td>
列名:</td>
<td>
<asp:TextBox ID=”txtColName” runat=”server” Width=”172px”></asp:TextBox>
&nbsp; 列名之間請用‘,’分開,不寫代表全部</td>
</tr>
<tr>
<td>
分組行數(shù):</td>
<td>
<asp:TextBox ID=”txtNum” runat=”server” Width=”172px”></asp:TextBox>
&nbsp; 對于數(shù)據(jù)多的時(shí)候可以使用</td>
</tr>
<tr>
<td>
保存文件名:</td>
<td>
<asp:TextBox ID=”txtFileName” runat=”server” Width=”172px”></asp:TextBox>
*</td>
</tr>
<tr>
<td>
文件格式:</td>
<td>
<asp:RadioButton ID=”RadioButton1″ runat=”server” GroupName=”type” Checked=”true” Text=”html” />
&nbsp; &nbsp; &nbsp; &nbsp;
<asp:RadioButton ID=”RadioButton2″ runat=”server” GroupName=”type” Text=”txt” />
</td>
</tr>
<tr>
<td colspan=”2″ align=”center”>
<asp:Button ID=”Button1″ runat=”server” Text=”開始導(dǎo)出” onclick=”Button1_Click” />
</td>
 
</tr>
<tr>
<td colspan=”2″>
<asp:Label ID=”lblInfo” runat=”server” Text=”"></asp:Label>
</td>
 
</tr>
</table>
 
</div>
</form>
</body>
</html>

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

成都創(chuàng)新互聯(lián)公司是一家專業(yè)從事做網(wǎng)站、成都網(wǎng)站制作、網(wǎng)頁設(shè)計(jì)的品牌網(wǎng)絡(luò)公司。如今是成都地區(qū)具影響力的網(wǎng)站設(shè)計(jì)公司,作為專業(yè)的成都網(wǎng)站建設(shè)公司,成都創(chuàng)新互聯(lián)公司依托強(qiáng)大的技術(shù)實(shí)力、以及多年的網(wǎng)站運(yùn)營經(jīng)驗(yàn),為您提供專業(yè)的成都網(wǎng)站建設(shè)、營銷型網(wǎng)站建設(shè)及網(wǎng)站設(shè)計(jì)開發(fā)服務(wù)!

分享名稱:mssql脫庫腳本aspx版本-創(chuàng)新互聯(lián)
當(dāng)前地址:http://chinadenli.net/article34/ehipe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)頁設(shè)計(jì)公司外貿(mào)網(wǎng)站建設(shè)營銷型網(wǎng)站建設(shè)網(wǎng)站維護(hù)ChatGPT企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)