By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.