标题:SqlDataAdapter问题
只看楼主
tankin
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2011-4-12
结帖率:33.33%
 问题点数:0 回复次数:0 
SqlDataAdapter问题
public static DataSet GetDataSet(DataSet daSearch,string []tableName,string []sqltext)
        {
            if(daSearch!=null)
            {
                daSearch.Clear();
            }

            SqlConnection conn=null;
            try
            {
                for(int i=1;i<tableName.Length+1;i++)
                {
                    conn = new SqlConnection(CONN_STRING);
                   SqlDataAdapter Adapter=new SqlDataAdapter(sqltext[i-1],conn);

                    SqlCommandBuilder Builder = new SqlCommandBuilder(Adapter);
                    Adapter.Fill(daSearch,tableName[i-1]);
                }
                return daSearch;
            }
            catch
            {
                conn.Close();
                throw;
            }
        }

以上红色字怎么样能循环更改 sqlDataAdapter 的命名,
搜索更多相关主题的帖子: null 
2011-04-27 11:40



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-338095-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.109124 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved