PC Review


Reply
Thread Tools Rate Thread

Add and then edit a rec in ado.net with vb.net

 
 
Sal
Guest
Posts: n/a
 
      9th Feb 2005
I have what I feel should be a simple operation, but I cannot seem to
get it to work. I have a table from a dataset that is bound to winform
controls. I would like to add a record, set some default values, and
the allow the nuser to edit the data. I am successful in adding the
data, but the controls remain blank. How do I position the dataset on
the new row and have that reflected in the controls?

Here is my code:

Dim drwTemp As DataRow = dsTars1.Tranactions.NewRow()
drwTemp("TransDate") = Date.Now
drwTemp("transcnt") = 2
drwTemp("actCode") = "2000"
drwTemp("Amount") = 10000
dsTars1.Tranactions.Rows.Add(drwTemp)


Thanks,

Sal

 
Reply With Quote
 
 
 
 
NuTcAsE
Guest
Posts: n/a
 
      9th Feb 2005
What controls are you binding to? If you are using BindingContext to
bind to text boxes and stuff, you need to move the CurrencyManager to
the position of the newly added row. If your binding to a data grid it
should happen on its own.

NuTcAsE

 
Reply With Quote
 
Sal
Guest
Posts: n/a
 
      10th Feb 2005

NuTcAsE wrote:
> What controls are you binding to? If you are using BindingContext to
> bind to text boxes and stuff, you need to move the CurrencyManager to
> the position of the newly added row. If your binding to a data grid

it
> should happen on its own.
>
> NuTcAsE


I am new to vb.net and sometimes make stupid mistakes. The contols
were not bound. Duh! I thought I did this but your reply made ,me
double check.


Thanks,

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot edit Tools/Folder Options/File Types/XLS/Advanced/Edit richardliebert Windows XP Accessibility 0 25th Mar 2010 11:18 AM
Change Word Edit>SelectAll to Edit>Select>SubMenu like Edit>Clear> =?Utf-8?B?TW9udGUgSGFucmFoYW4=?= Microsoft Word New Users 9 11th Jun 2006 07:52 PM
GridView edit validation, edit dropdown list, delete popup confirm =?Utf-8?B?a2Vu?= Microsoft ASP .NET 1 23rd Jan 2006 12:51 PM
Word 2003 can't select picture editor in tools edit menu or edit p =?Utf-8?B?UGVycGxleGVkIGluIEJyb29rbHlu?= Microsoft Word Document Management 6 3rd Jul 2005 10:26 AM
help-edit copy and edit paste wont work, cant restore files in recycle bin either Neal Windows XP General 1 17th Oct 2004 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:26 PM.