473,387 Members | 1,420 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.

Doing some extra task while saving databind Controls in VB.Net 2005 ?

I have created a form using Data Sources in VB.Net 2005, and Binding
Navigator, even I did not write a single line of code and data is
displaying, saving, deleting perfectly with the click of buttons on Binding
Navigator.

Now, what I want, that if the user clicks on the Save Button of Binding
Navigator, one field of that table should be saved with Current Date and
Time.

Do I need to use BuyerBindingSource, BuyerTableAdapter or dsBuyer (typed
dataset).

How can I do so? Any example will be highly appreciated.

Best Regards,

Luqman

Mar 28 '06 #1
4 2440
Hi,

You can get the current datarow this way

Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ProductsBindingNavigatorSaveItem.Click

Me.Validate()

Me.ProductsBindingSource.EndEdit()

Dim dr As DataRow =
Me.Inventory_Control1DataSet.Products.Item(Me.Prod uctsBindingSource.CurrencyManager.Position)

MessageBox.Show(dr.Item(0).ToString)

'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)

End Sub

Ken

----------------

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have created a form using Data Sources in VB.Net 2005, and Binding
Navigator, even I did not write a single line of code and data is
displaying, saving, deleting perfectly with the click of buttons on Binding
Navigator.

Now, what I want, that if the user clicks on the Save Button of Binding
Navigator, one field of that table should be saved with Current Date and
Time.

Do I need to use BuyerBindingSource, BuyerTableAdapter or dsBuyer (typed
dataset).

How can I do so? Any example will be highly appreciated.

Best Regards,

Luqman


Mar 28 '06 #2
You can also use the new (in 2005) Current property

Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ProductsBindingNavigatorSaveItem.Click

if Me.ProductsBindingSource.Current Is Nothing Then Exit Sub

Me.Validate()

Me.ProductsBindingSource.EndEdit()

Dim dr As DataRow = CType(Me.ProductsBindingSource.Current, DataRow)

MessageBox.Show(dr.Item(0).ToString)

'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)

End Sub

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hi,

You can get the current datarow this way

Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ProductsBindingNavigatorSaveItem.Click

Me.Validate()

Me.ProductsBindingSource.EndEdit()

Dim dr As DataRow =
Me.Inventory_Control1DataSet.Products.Item(Me.Prod uctsBindingSource.CurrencyManager.Position)

MessageBox.Show(dr.Item(0).ToString)

'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)

End Sub

Ken

----------------

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have created a form using Data Sources in VB.Net 2005, and Binding
Navigator, even I did not write a single line of code and data is
displaying, saving, deleting perfectly with the click of buttons on
Binding Navigator.

Now, what I want, that if the user clicks on the Save Button of Binding
Navigator, one field of that table should be saved with Current Date and
Time.

Do I need to use BuyerBindingSource, BuyerTableAdapter or dsBuyer (typed
dataset).

How can I do so? Any example will be highly appreciated.

Best Regards,

Luqman



Mar 29 '06 #3
Hi,

Ok, I understood, is it possible to use Field Names with Data Row.

for example:

Dim dr As DataRow = CType(Me.ProductsBindingSource.Current, DataRow)
dr.ProductID=123
dr.ProductName="ABC"
Me.ProductsBindingSource.EndEdit()
Me.ProductsTableAdapter.Update(Me.Inventory_Contro l1DataSet.Products)

Best Regards,

Luqman

"Jim Hughes" <NO*********@Hotmail.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
You can also use the new (in 2005) Current property

Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ProductsBindingNavigatorSaveItem.Click

if Me.ProductsBindingSource.Current Is Nothing Then Exit Sub

Me.Validate()

Me.ProductsBindingSource.EndEdit()

Dim dr As DataRow = CType(Me.ProductsBindingSource.Current, DataRow)

MessageBox.Show(dr.Item(0).ToString)

'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)

End Sub

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hi,

You can get the current datarow this way

Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ProductsBindingNavigatorSaveItem.Click

Me.Validate()

Me.ProductsBindingSource.EndEdit()

Dim dr As DataRow =
Me.Inventory_Control1DataSet.Products.Item(Me.Prod uctsBindingSource.Currency
Manager.Position)
MessageBox.Show(dr.Item(0).ToString)

'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)

End Sub

Ken

----------------

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have created a form using Data Sources in VB.Net 2005, and Binding
Navigator, even I did not write a single line of code and data is
displaying, saving, deleting perfectly with the click of buttons on
Binding Navigator.

Now, what I want, that if the user clicks on the Save Button of Binding
Navigator, one field of that table should be saved with Current Date and Time.

Do I need to use BuyerBindingSource, BuyerTableAdapter or dsBuyer (typed dataset).

How can I do so? Any example will be highly appreciated.

Best Regards,

Luqman




Mar 29 '06 #4
Yes, if you use a "Typed DataSet" instead of a generic DataRow.

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
Hi,

Ok, I understood, is it possible to use Field Names with Data Row.

for example:

Dim dr As DataRow = CType(Me.ProductsBindingSource.Current, DataRow)
dr.ProductID=123
dr.ProductName="ABC"
Me.ProductsBindingSource.EndEdit()
Me.ProductsTableAdapter.Update(Me.Inventory_Contro l1DataSet.Products)

Best Regards,

Luqman

"Jim Hughes" <NO*********@Hotmail.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
You can also use the new (in 2005) Current property

Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ProductsBindingNavigatorSaveItem.Click

if Me.ProductsBindingSource.Current Is Nothing Then Exit Sub

Me.Validate()

Me.ProductsBindingSource.EndEdit()

Dim dr As DataRow = CType(Me.ProductsBindingSource.Current, DataRow)

MessageBox.Show(dr.Item(0).ToString)

'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)

End Sub

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> You can get the current datarow this way
>
> Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As
> System.Object, ByVal e As System.EventArgs) Handles
> ProductsBindingNavigatorSaveItem.Click
>
> Me.Validate()
>
> Me.ProductsBindingSource.EndEdit()
>
> Dim dr As DataRow =
> Me.Inventory_Control1DataSet.Products.Item(Me.Prod uctsBindingSource.Currency
Manager.Position) >
> MessageBox.Show(dr.Item(0).ToString)
>
> 'Me.ProductsTableAdapter.Update(Me.Inventory_Contr ol1DataSet.Products)
>
> End Sub
>
>
>
> Ken
>
> ----------------
>
> "Luqman" <pe*******@cyber.net.pk> wrote in message
> news:%2****************@TK2MSFTNGP12.phx.gbl...
>>I have created a form using Data Sources in VB.Net 2005, and Binding
>>Navigator, even I did not write a single line of code and data is
>>displaying, saving, deleting perfectly with the click of buttons on
>>Binding Navigator.
>>
>> Now, what I want, that if the user clicks on the Save Button of
>> Binding
>> Navigator, one field of that table should be saved with Current Date and >> Time.
>>
>> Do I need to use BuyerBindingSource, BuyerTableAdapter or dsBuyer (typed >> dataset).
>>
>> How can I do so? Any example will be highly appreciated.
>>
>> Best Regards,
>>
>> Luqman
>>
>>
>>
>>
>>
>
>



Mar 30 '06 #5

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

Similar topics

1
by: Stephen | last post by:
I have a really annoying problem with a datagrid. I have an application which populates a datagrid on the onclick event of a button. The datagrid is bound to an ArrayList which holds the values. ...
2
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update...
1
by: Andreas Klemt | last post by:
Hello, for what is Page.DataBind useful and what is it doing? Thanks for any answer! Andreas
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
2
by: saleek | last post by:
I was wondering if there is a way I can add an extra header to a datagrid? I found this solution on the internet - but it seems quite old and didn't work for me. ...
3
by: Ben Dewey | last post by:
Hey everyone, I have a wierd issue i can't seem to find out whats going on. I have a Control for a Shopping Cart Merchant Page called OrderStatus.ascx Inside that control there is a Repeater...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
2
by: Don Miller | last post by:
I have controls (dropdown list, radiobutton list) that are bound to an SQLDataSource. In the SELECT statement in the DataSource configuration I have tried to include other columns that would be...
6
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.