473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

BindingSource.AddNew Method

After I use BindingSource.AddNew Method. (in my code is
OrderBindingSource.AddNew).

How can I set field value.

like
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
OrderBindingSource.AddNew()
DsOrder.Order("BillID") = "Test"
End Sub
this is error 'Property 'Item' is 'ReadOnly'

Thank you everyone.
Apr 17 '07 #1
2 12406
If you are binding to a DataTable, then you can try code like:

Dim drv As DataRowView = CType(OrderBindingSource.AddNew(),
DataRowView)
drv("BillD") = "someValue"
drv.EndEdit()

=======================
Clay Burch
Syncfusion, Inc.

Apr 17 '07 #2
ClayB wrote:
If you are binding to a DataTable, then you can try code like:

Dim drv As DataRowView = CType(OrderBindingSource.AddNew(),
DataRowView)
drv("BillD") = "someValue"
drv.EndEdit()

=======================
Clay Burch
Syncfusion, Inc.
Thank you very much. :D
May 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Rodriguez | last post by:
I have a custom business object collection based on the CSLA.NET framework from Rockfor Lhotka's "Expert C# Business Objects" book. I bound my winform to the object and when I open the screen the...
1
by: Leonardo | last post by:
Hi. I'm trying to build my first application with database access using VB 2005. I'm a VB 6 programmer and learning everything again has been challenging. I managed to write a code using some tips...
0
by: Geoff | last post by:
Hi folks Calling BindingSource.ResetCurrentItem() is changing the BindingSource.Position in a way I don't understand. If I'm understanding the docs correctly, ResetCurrentItem() should simply...
1
by: Pieter | last post by:
Hi, I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the...
2
by: Dustin Davis | last post by:
I'm trying to add a new row to my database using the BindingSource. I assume it is possible... Below is my code snippet: Dim drvZone As DataRowView Try drvZone =...
4
by: shibeta | last post by:
Hello, I have problem with DataGridView and BindingSource. I have created DataSet and added TableData to it with manualy created columns (without DataAdapter - I'm not using MSSQL). On the Form I...
1
by: Alexander Loose | last post by:
Hello, I am using the BindingSource.Find-Methode to find an Item in my BindingSource. This works fine to find the exact pattern, but now I search for a fuzzy finding method. For example: ...
0
nev
by: nev | last post by:
When bindingsource.addnew, it fires positionchanged event. When movenext, moveprevious, etc, it also fires positionchanged event. If I am to place code in positionchanged event, how will I...
0
nev
by: nev | last post by:
Have any of you encountered this? And how did you correct it? bs.addnew() automatically moves the position to the new record. But mine doesn't. I have 3 bindingsources in my program, all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.