Tibin Jose

Tibin Jose

  • NA
  • 1
  • 1.9k

System.Data.SqlClient.SqlException was unhandled by user cod

Dec 28 2012 12:25 AM
         private void FrmClientMaster_Load(object sender, EventArgs e)
        {
            Global.GetServerDetails();
            this.EnableDisableControls("LOAD");
            LoadCombo(); 
        }

        private void LoadCombo()
        {
            clsSqlObj.CreateCon();

            Global.GtSQLString = "select countryid,countryname from Country where CompanyId=" + Global.GiInstitutionId;
            cmbCountry.DataSource = clsSqlObj.SqlDataTable(Global.GtSQLString);
            cmbCountry.DisplayMember = "countryname";
            cmbCountry.ValueMember = "countryid";
            clsSqlObj.CloseConn();
        }





public DataTable SqlDataTable(String SQLString)
        {

            SqlDataAdapter sqlda = new SqlDataAdapter(SQLString, sqlcon);
            DataTable Dt = new DataTable();
            sqlda.Fill(Dt);
            return Dt;
        }


the error is near sqlda.Fill(Dt);......thanx in advance

Answers (1)