我使用3Tier Arch登录表单我不理解代码的某些部分 [英] Am Using 3Tier Arch For Login Form I Dont Understand Some Part Of The Code
本文介绍了我使用3Tier Arch登录表单我不理解代码的某些部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public DataTable ExecuteSelectCommand(SqlCommand command)
{
DataTable table = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter(command);
sda.Fill(table);
return 表;
}
i不理解公共DataTable ExecuteSelectCommand(SqlCommand命令),代码中没有任何查询
解决方案
ExecuteSelectCommand是一个函数,它将调用主页面代码或按钮代码来生成表格数据。 命令 - 一个参数,它将传递一个主页面或按钮代码,你正在使用这个函数。
ExecuteSelectCommand函数返回表,这就是为什么它的数据类型是DataTable。
来到公共它是C#中的访问量词,表示您可以在程序或项目中的任何位置使用此函数,您可以在此处调用此类或对象
public DataTable ExecuteSelectCommand(SqlCommand command)
{
DataTable table = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter(command);
sda.Fill(table);
return table;
}
i dont understand public DataTable ExecuteSelectCommand(SqlCommand command) without any query in code
解决方案
"ExecuteSelectCommand" is a function which will call in main page code or button code which results a table data. "Command" - a parameter which will pass form a main page or button code where you are using this function.
"ExecuteSelectCommand" function return table that's why it's data type is DataTable.
Coming to "Public" it is a access quantifier in C# indicate you can use this function any where in the program or project where you call this class or object.
这篇关于我使用3Tier Arch登录表单我不理解代码的某些部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文