/****** SSMS 中 SelectTopNRows 命令的指令碼 ******/
SELECT TOP 1000 [RowId]
,[ProductID]
,[ProductName]
,[UnitPathId]
,[Item]
,[Amount]
,[Size]
,[Kind]
,[OriginalHolder]
,[Worth]
,[Material]
,[ObjectTime]
,[Maker]
,[Status]
,[Place]
,[ImageUrl]
,[Remark]
,[Remark2]
,[CreateDate]
,[CreateUserId]
,[UpdateDate]
,[UpdateUserId]
,[Cancel],
CONVERT(varchar,RowId) as string
FROM [AFM].[dbo].[AFM_Product]
order by CONVERT(int,ProductID) asc
2019年10月29日 星期二
2019年10月28日 星期一
C#專案中操作Excel檔案——使用NPOI庫
https://www.itread01.com/content/1546854857.html
https://dotblogs.com.tw/joysdw12/2013/01/14/87228
http://webnas.bhes.ntpc.edu.tw/joomla/index.php/2015-02-26-16-55-00/116-server-excel-npoi-library
https://dotblogs.com.tw/frank_information_workstation/2016/04/21/174933
1. 將NPOI相關dll放入網站的 bin 資料夾
或是用 nuget下載。在「套件管理器主控台」輸入:Install-Package NPOI
https://dotblogs.com.tw/joysdw12/2013/01/14/87228
http://webnas.bhes.ntpc.edu.tw/joomla/index.php/2015-02-26-16-55-00/116-server-excel-npoi-library
https://dotblogs.com.tw/frank_information_workstation/2016/04/21/174933
1. 將NPOI相關dll放入網站的 bin 資料夾
或是用 nuget下載。在「套件管理器主控台」輸入:Install-Package NPOI
2019年10月27日 星期日
GridView RowCommand與PageIndexChanging事件
https://bbs.csdn.net/topics/350100104
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "edit_admin")
{
GridView1.EditIndex = Convert.ToInt32(e.CommandArgument);
db_common();
}
else
{
if (e.CommandName == "Page")
{
}
else
{
SqlCommand cmd = new SqlCommand();
string sql = "";
fun fun = new fun();
fun.Page = this.Page;
DataTable dt = new DataTable();
Button x = e.CommandSource as Button;
TextBox textBox1 = x.FindControl("TextBox1") as TextBox;
TextBox textBox2 = x.FindControl("TextBox2") as TextBox;
TextBox textBox3 = x.FindControl("TextBox3") as TextBox;
Label label = x.FindControl("Label3") as Label;
sql = "UPDATE AFM_USER SET Name = @Name,MyPhone = @MyPhone,Title = @Title,UpdateDate=@UpdateDate,UpdateUserId=@UpdateUserId WHERE Account=@Account ";
cmd.CommandText = sql;
cmd.Parameters.Clear();
cmd.Parameters.AddWithValue("@Account", label.Text);
cmd.Parameters.AddWithValue("@Name", textBox1.Text);
cmd.Parameters.AddWithValue("@MyPhone", textBox3.Text);
cmd.Parameters.AddWithValue("@Title", textBox2.Text);
cmd.Parameters.AddWithValue("@UpdateDate", DateTime.Now);
cmd.Parameters.AddWithValue("@UpdateUserId", Session["Account"].ToString());
int a = fun.CmdExec(cmd);
if (a == 0)
{
fun.message("更新失敗!!!");
}
else
{
fun.message("已成功更新了" + a + "筆資料");
}
GridView1.EditIndex = -1;
db_common();
}
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "edit_admin")
{
GridView1.EditIndex = Convert.ToInt32(e.CommandArgument);
db_common();
}
else
{
if (e.CommandName == "Page")
{
}
else
{
SqlCommand cmd = new SqlCommand();
string sql = "";
fun fun = new fun();
fun.Page = this.Page;
DataTable dt = new DataTable();
Button x = e.CommandSource as Button;
TextBox textBox1 = x.FindControl("TextBox1") as TextBox;
TextBox textBox2 = x.FindControl("TextBox2") as TextBox;
TextBox textBox3 = x.FindControl("TextBox3") as TextBox;
Label label = x.FindControl("Label3") as Label;
sql = "UPDATE AFM_USER SET Name = @Name,MyPhone = @MyPhone,Title = @Title,UpdateDate=@UpdateDate,UpdateUserId=@UpdateUserId WHERE Account=@Account ";
cmd.CommandText = sql;
cmd.Parameters.Clear();
cmd.Parameters.AddWithValue("@Account", label.Text);
cmd.Parameters.AddWithValue("@Name", textBox1.Text);
cmd.Parameters.AddWithValue("@MyPhone", textBox3.Text);
cmd.Parameters.AddWithValue("@Title", textBox2.Text);
cmd.Parameters.AddWithValue("@UpdateDate", DateTime.Now);
cmd.Parameters.AddWithValue("@UpdateUserId", Session["Account"].ToString());
int a = fun.CmdExec(cmd);
if (a == 0)
{
fun.message("更新失敗!!!");
}
else
{
fun.message("已成功更新了" + a + "筆資料");
}
GridView1.EditIndex = -1;
db_common();
}
}
}
2019年10月26日 星期六
[ASP.NET]讀取 Excel 的方式 - 使用 Excel模組 方式
visual studio 2015 找不到參考Microsoft.Office.Interop.Excel
參考 > 加入參考 > 瀏覽 > C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel > 往裡面的資料夾內找到 Microsoft.Office.Interop.Excel.dll
像我的路徑會變成
C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll
訂閱:
文章 (Atom)
WPF聊天室应用(ASP.NET Core SignalR)
WPF聊天室应用(ASP.NET Core SignalR) https://www.bilibili.com/video/BV1Q741187Si?p=2 https://www.bilibili.com/video/BV1UV411e75T?from=search...
-
http://emn178.pixnet.net/blog/post/93557502-%E9%80%A3%E7%B5%90%E4%B8%B2%E5%88%97%28linked-list%29