= 0 and < the PageCount." error message when I click on the Edit button on
any pages in the datagrid besides the first one. Can someone tell me what I
am missing?
The code highlighted with an error is:
Line 204: adapter.Fill(ds );
Line 205: dgCustInfo.Data Source = ds;
Line 206: dgCustInfo.Data Bind(); <----------------highlighted
Line 207: conn.Close();
Line 208:
The code on that method is:
private void editRow(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
//dgCustInfo.Edit ItemIndex = e.Item.ItemInde x;
SqlConnection conn = new SqlConnection
(ConfigurationS ettings.AppSett ings["SqlConnectionS tring"]);
conn.Open();
SqlCommand dataCommand = new SqlCommand();
dataCommand.Con nection = conn;
dataCommand.Com mandText = "SELECT GEM.customers.n ame AS [Institution
Name], "
+ "GEM.customers. CustomerSince AS [Customer Since], "
+ "GEM.contacts.n ame_first AS [First Name], "
+ "GEM.contacts.n ame_last AS [Last Name], "
+ "GEM.customers. address_1 AS Address, "
+ "GEM.customers. city AS City, "
+ "GEM.customers. state AS State, "
+ "GEM.customers. province AS Province, "
+ "GEM.customers. zip_code AS [Zip Code], "
+ "GEM.customers. postal_code AS [Postal Code], "
+ "GEM.customers. country AS Country, "
+ "GEM.customers. phone AS Phone, "
+ "GEM.contacts.e mail AS [E-mail Address], "
+ "GEM.customers. cust_id "
+ "FROM GEM.customers INNER JOIN "
+ "GEM.config_use rnames ON "
+ "GEM.customers. cust_id = GEM.config_user names.cust_id INNER JOIN "
+ "GEM.contac ts ON GEM.config_user names.contact_i d =
GEM.contacts.co ntact_id "
+ "WHERE (GEM.customers. cust_id ='" + e.Item.Cells[16].Text + "')";
SqlDataAdapter adapter = new SqlDataAdapter( dataCommand);
DataSet ds = new DataSet();
adapter.Fill(ds );
dgCustInfo.Data Source = ds;
dgCustInfo.Data Bind();
conn.Close();
}