Microsoft
Software
Hardware
Network
Question : How to clear a recordset
In my project I have a typed dataset and a binding source to go with my bound controlls on a form. I have enteties in a separate project and a WCF-service to handle the data.
The Dataset is calld dsCustomer.
When I load the form I do this:
CustomerBindingSource.AddN
ew()
And the OK-button have this:
CustomerBindingSource.EndE
dit()
CustomerID = proxy.SaveNewCustomer(DSCu
stomer)
The customer is saved and everything is fine. Next time I open the form the old record is still in the dataset and I can't remove it. with dsCustomer.Clear and CustomerBindingSource.Clea
r throws an exception.
I guess I'm doing something wrong here. I'd be greatful for some help. (I run .NET Framework 4.0)
Best Regards
Tomas
Answer : How to clear a recordset
In the OK_button event, add a line to re-instantiate the dataset, like this:
CustomerBindingSource
.EndEdit()
CustomerID
= proxy.SaveNewCustomer(DSCu
stomer)
DSC
ustomer = New DataSet
Random Solutions
Cable Type/Pinout for RJ45 to RJ45 T1/E1 between two routers
Symantec Email Proxy
MailChimp WordPress Plugin Embedded styles display: none; hiding form, Part 2
Changing Domain Controllers + DNS - How to get new clients to accept new DNS server
Thecus N8800 iscsi not showing in ESX4
Email Being Blocked
Blogger loses Google analytics
Formview - System.NullReference Exception when using findcontrol
seo and non-pages
Buckling calculation using Tetmajers formula