webconfig:
<appSettings>
<add key="御携迹ConnectionString" value="server=.;database=shujuku;uid=sa;pwd=123" />
</appSettings>
1.gridview:
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString());
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from 表", conn);
DataSet ds = new DataSet();
try
{
da.Fill(ds, "testTable");
this.GridView1.DataSource = ds.Tables["testTable"];
this.GridView1.DataBind();
}
catch (Exception error)
{
Response.Write(error.ToString());
}
finally
{
conn.Close();
}
2.DataList:
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString());
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from 表", conn);
DataSet ds = new DataSet();
try
{
da.Fill(ds, "testTable");
this.DataList1.DataSource = ds.Tables["testTable"];
this.DataList1.DataBind();
}
catch (Exception error)
{
Response.Write(error.ToString());
}
finally
{
conn.Close();
}
3.SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"隐凯].ToString());
conn.Open();
try
{
SqlDataAdapter da = new SqlDataAdapter("select * from 表", conn);
DataSet ds = new DataSet();
da.Fill(ds, "testTable");
this.DropDownList1.DataTextField = "字段";
this.DropDownList1.DataValueField = "id";
this.DropDownList1.DataSource = ds.Tables["testTable"];
this.DropDownList1.DataBind();
}
catch (Exception error)
{
Response.Write(error.ToString());
}
finally
{
conn.Close();
}
4.ListBox:
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"镇并].ToString());
try
{
SqlDataAdapter da = new SqlDataAdapter("select id from table", conn);
DataSet ds = new DataSet();
da.Fill(ds, "testTable");
this.ListBox1.DataTextField = "id";
this.ListBox1.DataValueField = "id";
this.ListBox1.DataSource = ds.Tables["testTable"];
this.ListBox1.DataBind();
}
catch (Exception error)
{
Response.Write(error.ToString());
}
finally
{
conn.Close();
}
5.Lable
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString());
SqlDataAdapter da = new SqlDataAdapter("select id from table", conn);
DataSet ds = new DataSet();
try
{
da.Fill(ds, "testTable");
this.Lable1.Text=ds.Tables[0].Rows[0]["id"].Tostring();
}
catch (Exception error)
{
Response.Write(error.ToString());
}
finally
{
conn.Close();
}
相关知识
宠物殡葬需要什么手续
做宠物殡葬要什么手续(宠物殡葬服务需要什么资质)
从宠物医保到宠物殡葬.docx
中华人民共和国农业部令(第19号) 动物诊疗机构管理办法
光明专业宠物殡葬机构 服务至上 宠川联供应
开个宠物店要哪些审批手续和证件?
哈尔滨宠物火化流程,正规宠物殡葬机构服务详情-宠物去世必看!
我国宠物殡葬服务行业:极富潜力下也面临众多难题 市场发展仍旧道阻且长
《动物诊疗机构管理办法(草案)》公开征求意见
【光明专业宠物殡葬机构 服务至上 宠川联供应】批发
网址: 设立宠物殡葬机构需哪些手续? https://m.mcbbbk.com/newsview22793.html
上一篇: 宠物殡葬:用温暖的方式跟爱宠说再 |
下一篇: 什么是宠物殡葬 |