返回dataset的问题 public DataSet getassignentry( ...){ return //DataSet 类型} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void button1_Click(object sender, System.EventArgs e) { string TableName = "BM_Doctor"; string ConnectionStr = "workstation id=ZHAOLIREN;packet size=4096;user id=sa;data source=YLGLSERVER;persist security info=True;initial catalog=ylgldb;password=sa"; string RunSQL = "select * from BM_Doctor"; dataGrid1.DataSource = getDateSet(ConnectionStr,RunSQL,TableName); dataGrid1.DataMember = TableName; } private System.Data.DataSet getDateSet(string ConnectionStr,string RunSQL,string TableName) { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(ConnectionStr); conn.Open(); System.Data.SqlClient.SqlDataAdapter sda = new System.Data.SqlClient.SqlDataAdapter(RunSQL,conn); System.Data.DataSet ds = new System.Data.DataSet(); sda.Fill(ds,TableName); conn.Close(); return ds; } public EntryDataSet GetAssignedEntry(string EntryId){ 先定义一个包含EntryId的SQL string; DataSet ds=new DataSet(); 然后定义ds的connection和command; return ds;----//最后返回ds; } 如何获取同一文件夹中修改时间最新的图片!急!急!急!急! 我用socket做二进制流的局域网文件传送出了bug winform实现逐行读取并对读取内容做修改 求代码 急急急 求助 C#关于时间格式的比较? 用正则语句提取一点txt内容,并统计出现次数 Ext.net里面的GridPanel怎么绑定数据? c#清空内存【百分求助】 文件读写,求助,火急! 如何查找一段字符串的位置 C# 可以调用Java的webservice么? 在winform中如果在datagrid中实现多重表头 dataset的绑定问题(在线等待)
private void button1_Click(object sender, System.EventArgs e)
{
string TableName = "BM_Doctor";
string ConnectionStr = "workstation id=ZHAOLIREN;packet size=4096;user id=sa;data source=YLGLSERVER;persist security info=True;initial catalog=ylgldb;password=sa";
string RunSQL = "select * from BM_Doctor";
dataGrid1.DataSource = getDateSet(ConnectionStr,RunSQL,TableName);
dataGrid1.DataMember = TableName;
}
private System.Data.DataSet getDateSet(string ConnectionStr,string RunSQL,string TableName)
{
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(ConnectionStr);
conn.Open();
System.Data.SqlClient.SqlDataAdapter sda = new System.Data.SqlClient.SqlDataAdapter(RunSQL,conn);
System.Data.DataSet ds = new System.Data.DataSet();
sda.Fill(ds,TableName);
conn.Close();
return ds;
}
{
先定义一个包含EntryId的SQL string;
DataSet ds=new DataSet();
然后定义ds的connection和command;
return ds;----//最后返回ds;
}