I have created a table (CUSTOMERS) in the SQL database with the following parameters:
Name datatype length
CustomerID int 4
CustomerName varchar 50
CustomerAddress varchar 250
I'm using a stored procedure: GetCustomersbyID:
Alter procedure dbo.GetCustomersbyID
@id int
AS
select * from Customers
where CustomerID = @id
return
I then use a web service to retrieve this dataset which is displayed on a dropdown list in an infopath form from which you can select a customer name and once the name is selected the rest of the fields are populated using the customerID. The problem i am having is that i don't know to update this dataset to reflect the changes to this dataset
I tried the following:
I created a stored procedure "UpdateCustomer":
ALTER PROCEDURE dbo.UpdateCustomers
@id int,
@customername varchar(50),
@customeraddress varchar(250),
UPDATE Customers
SET Custo CustomerName = @customername, CustomerAddress = @customeraddress
WHERE CustomerID = @id
Then i use the following web service code:
public void update (DataSet ds)
{
sqlConnection1.open();
sqlDataAdapater1.update(ds);
sqlConnection1.close();
}
The sqlDataAdapter is configured with the storedprocedure GetCustomersbyID for the select command and UpdateCustomers for the update command
Then in the infopath form i use the update function for the main submit and geCustomerbyID function for the main query. But this just doesnot update the database when i make changes to the fields in the form and submit
If anyone has any suggestions please let me know i'm really struggling with this