Well first Which Datagrid are you referring to? you can try this in the "Click Event" for your binding. //Note this Will work if you are using Microsoft Enterprise Library //else, look at the Code and try to Convert it to one Using ADO //new DAL SUNIG dal = new SUNIG(); string msg = ""; //declare a new dataset DataSet ds = new DataSet(); //pass the data to to the dal, and fetch the data you want to Bind to the Grid. /*Note: your Stored Procedure Must have to Fetch all the Data from the Table you want to Bind with/without a criteria eg: ds = dal.fetchYOURDATA(ref msg); // do your Validation and Exception CHecking //eg if (msg != "") { MessageBox.Show("Put your Exception Message Here" + msg); return } //do your databinding here DataGridView1.Dataset = ds; DataGridview1.DataBind(); Hope it Helps!! :)
E
ebukaegonu2
@ebukaegonu2
Posts
-
How do I add row data directly to a DataGrid Class? -
How do I generate a Unique AlphaNumeric ID in C#i have tried Guid.NewGuid().ToString().GetHashCode().ToString("x").ToUpper(); but I do not get Unique Codes after 10,000 tries i need to add ABCDEFGHIJKLMNOPQRSTUVWXYZ and 1234567890 somebody help!!!