将代码更改为三层 [英] change the code into three tier
本文介绍了将代码更改为三层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的用户界面中有一个代码
I have a code in my ui
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ct"].ConnectionString);
try
{
con.Open();
}
catch (SqlException ex)
{
Response.Write(ex.ToString());
}
DataTable dt = new DataTable();
string query = "select column_name from information_schema.columns where table_name ='" + Session["name"] + "' " + "order by ordinal_position";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
sda.Fill(dt);
string ColumnsName_String = "";
for (int i = 0; i <= dt.Rows.Count - 1; i++)
{
ColumnsName_String = ColumnsName_String + "," + dt.Rows[i]["column_name"];
if (ColumnsName_String.StartsWith(","))
{
ColumnsName_String = ColumnsName_String.Remove(0, 1);
}
dl.table_name = Session["name"].ToString();
dl.column_name = ColumnsName_String.ToString();
bl.updatedata(dl);
}
我想将其更改为三层
你能帮我吗??
[edit]代码标签和列表[/edit]
i wants change it into three tier
can u help me????
[edit] code tags and tabulation [/edit]
推荐答案
可能对您有用;
http://social.msdn.microsoft.com/论坛/en-US/winformsapplications/thread/2c15af26-7758-4268-9568-5932225cca32 [ C#.NET中的三层体系结构 [ C#中的三层体系结构 [
Might be useful for you;
http://social.msdn.microsoft.com/Forums/en-US/winformsapplications/thread/2c15af26-7758-4268-9568-5932225cca32[^]
Three Layer Architecture in C# .NET[^]
3-tier architecture in C#[^]
Thanks,
Ambesh
使用它肯定可以帮助您了解3层体系结构
use this its surely help you to understand 3 tier architectureUse this.
这篇关于将代码更改为三层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文