//this is my BusinessLayer in a form of class (DataAccessLayer) //i have a class called Property and DataAccessLayer called BusinessLayer //and again i have store procedure on a sqlDtatabase called allOfProparty public DataTable AllofProperty() { using (SqlConnection sqlConn = new SqlConnection(ConnectionString)) { SqlCommand sqlCmd = new SqlCommand("allOfProparty", sqlConn); sqlCmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter sqlAdapter = new SqlDataAdapter(sqlCmd); DataTable ds = new DataTable(); try { sqlConn.Open(); sqlAdapter.Fill(ds); } catch (SqlException ex) { throw new Exception(ex.Message); } return ds; } }
DataAccessLayer da = new DataAccessLayer(); cmb_propertyNo.ItemsSource = (from n in da.AllofProperty.AsEnumerable()select n).ToList(); cmb_propertyNo.DisplayMemberPath="propertyNo";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)