标题:制作查询、删除界面出问题,新手求助
只看楼主
a741566797
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-6-10
 问题点数:0 回复次数:0 
制作查询、删除界面出问题,新手求助
public class DataBase1
    {
        private static string ConnString = "server=.;database=xcgl;uid=sa;pwd=123;";
        public DataTable GetListReDataTable(string paramSql)
        {
            DataTable mydt = new DataTable();
            SqlConnection mysqlconnection = new SqlConnection(ConnString);
            SqlCommand mycmd = new SqlCommand();
            mysqlconnection.Open();
            mycmd.Connection = mysqlconnection;
             = paramSql;
            SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mycmd);
            mySqlDataAdapter.Fill(mydt);(在这里出现问题“对象名xcgl无效”)

            mysqlconnection.Close();
            return mydt;
        }
        public int myExecuteNonQuery(string paramStr)
        {
            int returnValue = 0;
            SqlConnection mysqlconnection = new SqlConnection(ConnString);
            mysqlconnection.Open();
            SqlCommand mysqlcom = new SqlCommand(paramStr, mysqlconnection);
            returnValue = mysqlcom.ExecuteNonQuery();
            mysqlconnection.Close();
            return returnValue;
        }

    }
搜索更多相关主题的帖子: 查询 制作 database private public 
2012-06-10 02:10



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




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

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