"No mapping exists from object type System.Collections.Generic.List

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<pre class="prettyprint SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(sql,connection);
Console.WriteLine("Selectcommand" + adapter.SelectCommand);
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet,tablename);

SqlCommand insert = builder.GetInsertCommand();
String columndata=String.Empty;
String fileddata = String.Empty;
insert.Parameters.AddWithValue(headercolumn.ToString(), filecontent);


insert.ExecuteNonQuery();
adapter.Update(dataSet, tablename);[/code]
while reach insert.executenonquery it give error like "No mapping exists from object type System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] "

how to solve this

View the full article
 
Back
Top