js DataSet数据源处理代码_javascript技巧
程序员文章站
2022-05-20 13:33:39
...
[Ajax.AjaxMethod()]
public DataSet GetDataSet()
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:工作项目分析 estdb.mdb;Persist Security Info=True;");
DataSet ds = new DataSet();
try
{
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from t_name";
cmd.CommandType = CommandType.Text;
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(ds);
return ds;
}
catch
{
conn.Close();
throw;
}
}
[/code]
public DataSet GetDataSet()
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:工作项目分析 estdb.mdb;Persist Security Info=True;");
DataSet ds = new DataSet();
try
{
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from t_name";
cmd.CommandType = CommandType.Text;
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(ds);
return ds;
}
catch
{
conn.Close();
throw;
}
}
[/code]
复制代码 代码如下:
推荐阅读
-
javascript容错处理代码(屏蔽js错误)
-
javascript简写常用的12个技巧(可以大大减少你的js代码量)
-
Js代码优化规则和技巧(JavaScript优化)
-
让textarea自动调整大小的js代码_javascript技巧
-
从盛大通行证上摘下来的身份证验证js代码_javascript技巧
-
从基础开始建立一个JS代码库第1/2页_javascript技巧
-
js 代码集(学习js的朋友可以看下)_javascript技巧
-
IE6中使用position导致页面变形的解决方案(js代码)_javascript技巧
-
js取消单选按钮选中示例代码_javascript技巧
-
原生Js与jquery的多组处理, 仅展开一个区块的折叠效果_javascript技巧