PC Review


Reply
Thread Tools Rate Thread

database access

 
 
=?Utf-8?B?am9obiBhbmRyZXc=?=
Guest
Posts: n/a
 
      27th Nov 2004

--
hello
I have VB.net standard.
I thought this version has no data access but I have data controls .

Do these things work with standard?

Can i connect to a access database? I tried OLEadapter1 and a datagrid but
nothing happens when i click on datasource property like VB6...i dont know,
can anyone help please.
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      27th Nov 2004
Hi,

Click on the oledbdataadapter1 in the properties you will see in the
bottom you will see generate dataset. After that wizard is finished you
will see the dataset in the datasource property of the datagrid. One last
step in the form load event you need to fill the dataset.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

DataSet11.Clear()

OleDbDataAdapter1.Fill(DataSet11)

End Sub



Ken

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

"john andrew" <(E-Mail Removed)> wrote in message
news81E4AA8-7480-48E7-B24E-(E-Mail Removed)...

--
hello
I have VB.net standard.
I thought this version has no data access but I have data controls .

Do these things work with standard?

Can i connect to a access database? I tried OLEadapter1 and a datagrid but
nothing happens when i click on datasource property like VB6...i dont know,
can anyone help please.


 
Reply With Quote
 
=?Utf-8?B?am9obiBhbmRyZXc=?=
Guest
Posts: n/a
 
      27th Nov 2004
I have got a datagrid working, can I assign a datafield from a datasource to
a textbox like in VB6?

 
Reply With Quote
 
=?Utf-8?B?am9obiBhbmRyZXc=?=
Guest
Posts: n/a
 
      27th Nov 2004


"john andrew" wrote:

> I have got a datagrid working, can I assign a datafield from a datasource to
> a textbox like in VB6?
>


scrub that as i just found out what to do in databindings.

can I navigate like in VB6, move and add ect....can you do this?

 
Reply With Quote
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      27th Nov 2004
Hi,

TextBox1.DataBindings.Add("Text", DataSet11.Tables(0), "Country")



Ken

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

"john andrew" <(E-Mail Removed)> wrote in message
news:A00B5C75-261D-489A-BE9F-(E-Mail Removed)...
I have got a datagrid working, can I assign a datafield from a datasource to
a textbox like in VB6?


 
Reply With Quote
 
=?Utf-8?B?am9obiBhbmRyZXc=?=
Guest
Posts: n/a
 
      27th Nov 2004


"Ken Tucker [MVP]" wrote:

> Hi,
>
> TextBox1.DataBindings.Add("Text", DataSet11.Tables(0), "Country")
>
>
>
> Ken
>
> ------------------------
>
> "john andrew" <(E-Mail Removed)> wrote in message
> news:A00B5C75-261D-489A-BE9F-(E-Mail Removed)...
> I have got a datagrid working, can I assign a datafield from a datasource to
> a textbox like in VB6?
>
>


Thanks i will try it out,


How do I move next recprd for example? I n VB6 you have a recordset.( Where
can i find this information instead of asking so many questions)
>

 
Reply With Quote
 
james
Guest
Posts: n/a
 
      27th Nov 2004
In your declarations add:


Private bmb As BindingManagerBase

Then in the section where you make your connection: (or in Form Load if you are not making your connection in code)
bmb = Me.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)



To step forward thru the records:

Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click

If bmb.Position < bmb.Count - 1 Then

bmb.Position = bmb.Position + 1

' add code here to change the display......such as textboxes etc. that you might have bound to the datagrid fields.

End If

End Sub

To move backwards:

Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click

If bmb.Position > 0 Then

bmb.Position = bmb.Position - 1

End If

' add code here to change the display......such as textboxes etc. that you might have bound to the datagrid fields.

End Sub

This should give you and idea on how it works.
Good luck.
james


"john andrew" <(E-Mail Removed)> wrote in message news:BCCE7488-977B-4C2D-80EA-(E-Mail Removed)...
>
>
> "Ken Tucker [MVP]" wrote:
>
>> Hi,
>>
>> TextBox1.DataBindings.Add("Text", DataSet11.Tables(0), "Country")
>>
>>
>>
>> Ken
>>
>> ------------------------
>>
>> "john andrew" <(E-Mail Removed)> wrote in message
>> news:A00B5C75-261D-489A-BE9F-(E-Mail Removed)...
>> I have got a datagrid working, can I assign a datafield from a datasource to
>> a textbox like in VB6?
>>
>>

>
> Thanks i will try it out,
>
>
> How do I move next recprd for example? I n VB6 you have a recordset.( Where
> can i find this information instead of asking so many questions)
>>



 
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
Unable to open an Access database object - Access Database Becomes Inaccessible Suzane Brandy Microsoft Access 2 21st Apr 2010 07:33 AM
Converting Access 97 database to Access 2007 database galit Microsoft Access Getting Started 5 1st Jan 2008 08:51 PM
importing data from one access database to another access database =?Utf-8?B?Y2M=?= Microsoft Access Database Table Design 1 26th Feb 2007 04:36 PM
Export Relationships Diagram for four new tables from test(developer) ms access database to production ms access database Bosiljka Kostić Microsoft Access Getting Started 1 14th Feb 2007 11:45 PM
Export selected tables from old Access Database to new Access Database learning_codes@hotmail.com Microsoft Access Forms 1 5th Sep 2006 06:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:31 AM.