Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My application is failed when we importing file then server through message or my problems will occur but we will restart IIS server then it will work properly..please provide a good solution.


Server Error in '/vision' Application.

Column 'ClientNAme' does not belong to table Table.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Column 'ClientNAme' does not belong to table Table.

Source Error: 


Line 280:            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
Line 281:            {
Line 282:                dropDownClient.Items.Add(ds.Tables[0].Rows[i]["ClientNAme"].ToString());
Line 283:            }
Line 284:        }

Source File: d:\VSS\Published\Site\login.aspx.cs    Line: 282 

Stack Trace: 


[ArgumentException: Column 'ClientNAme' does not belong to table Table.]
   System.Data.DataRow.GetDataColumn(String columnName) +1775477
   System.Data.DataRow.get_Item(String columnName) +13
   logint.BindClientList() in d:\VSS\Published\Site\login.aspx.cs:282
   logint.Page_Load(Object sender, EventArgs e) in d:\VSS\Published\Site\login.aspx.cs:43
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Posted
Updated 2-May-13 2:17am
v2
Comments
Meena_be 2-May-13 8:28am    
Please Post ur code
KM Perumal 2-May-13 8:28am    
Post ur code for help
KM Perumal 2-May-13 8:50am    
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{

dropDownClient.Items.Add(ds.Tables[0].Rows[i][1].ToString());//change Like this
}
Er Atul Sharma 2-May-13 8:53am    
1 is what?
KM Perumal 2-May-13 8:59am    
1 indicated Ur Second Column,its working or not

1 solution

C#
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
dropDownClient.Items.Add(ds.Tables[0].Rows[i]["ClientNAme"].ToString());
dropDownClient.Items.Add(ds.Tables[0].Rows[i][1].ToString());//change Like this
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900