Welcome Guest Search | Active Topics | Log In | Register

TABLE MAPPING EXCEPTION Options · View
markyjj
#1 Posted : Saturday, August 23, 2008 4:49:52 PM

Rank: YAF Forumling


Joined: 7/4/2008
Posts: 7
Can someone please help me with the following I am getting a mappings exception as follows: 'Update unable to find TableMapping['MovTable1'] or DataTable 'MovTable1'.

This happens when I try to save the changes made when I have entered details onto a datagrid which is linked to a sql database..

the updated code I am now using is below....thanks for any help.


//code when loading data grid//
private void button3_Click(object sender, System.EventArgs e)
{ Form3 F3 = new Form3();
SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(MovAdapt);
MovAdapt.TableMappings.Add("MovMapping", "MovTable1"Wink;
Mcon.Open();
Movcmd.CommandText = "SELECT * FROM MovTable1";
MovAdapt.SelectCommand = Movcmd;
MovAdapt.Fill(Movset1, "MovTable1"Wink;
F3.dataGrid1.DataSource = Movset1;
F3.Show();
}


//code behind the save button//
private void button1_Click(object sender, System.EventArgs e)
{
F1.MovAdapt.Update(F1.Movset1, "MovTable1"Wink;
Form1.Mcon.Close();

}




}
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.062 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET