Hi, I am using newest nettiers 2, Visual Studio 2005, and Ms SQL server 2000.
How to insert a new record with nettiers? I tried this code but failed :
(Database for this code is taken from "NorthWind" sample database )
Customers myCustomer = new Customers();
myCustomer.CustomerID = "CUST";
myCustomer.CompanyName = "CUST";
CustomersService myServices = new CustomersService();
if (myServices.Insert(myCustomer))
{
Label1.Text = "Success";
}
else
{
Label1.Text = "Failed";
}
Label1 always display "Failed". Something wrong with my code? (I am sure no problem with database and its connection because I able to retrieve some record from customer table). Later, I tried this code, but also failed :
Customers myCustomer = new Customers();
myCustomer.CustomerID = "CUST";
myCustomer.CompanyName = "CUST";
CustomersService myServices = new CustomersService();
TList<Customers> myList = myServices.GetAll();
myList.Add(myCustomer);
myList.AcceptChanges();
GridView1.DataSource = myList;
GridView1.DataBind();
Oddly, my GridView1 showing record of "mycustomer" but not in database.
Thanks
Alan