DataBind

Aug 29 2004 12:29 PM
Hi Guys I trying to DataBind some data to a TextBox. The Name of the DataBase is called Test.sdf and the Table is called RFGunInventory and the column is called RFGunNumber Now I tried using the follwong codes but I getting an ERROR saying An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll This are the codes I'm using MyDataAdapter.SelectCommand = New SqlCeCommand MyDataAdapter.SelectCommand.Connection = MyConnection MyDataAdapter.SelectCommand.CommandText = "Select RFGunNumber From RFGunInventory" MyConnection.Open() MyDataAdapter.SelectCommand.ExecuteNonQuery() MyConnection.Close() MyDataAdapter.Fill(MyDataset, "RFGunInventory") txtRFGunNumber.DataBindings.Add(New Binding("Text", MyDataset, "RFGunInventory")) I have tried to add the name of the column after the table Name. So it look like this txtRFGunNumber.DataBindings.Add(New Binding("Text", MyDataset, "RFGunInventory.RFGunNumber")) When I try using the above line of codes I get the following ERROR saying An unhandled exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll Additional information: ArgumentException