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

How do I do this

P: n/a
Dib
Hi,

This code is in VB 6 I have converted the code into DOT net 2003.

I need to change this code and some Listbox and combobox.
here is my funvtion code.

If AnyRS.BOF And rs.EOF = True Then Exit Sub

'UPGRADE_WARNING: TypeOf has a new behavior. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1041"'

If TypeOf AnyBox Is System.Windows.Forms.ComboBox Or TypeOf AnyBox Is
System.Windows.Forms.ListBox Then

AnyRS.MoveFirst()

Do Until AnyRS.EOF

If AnyRS.Fields.Count > 1 Then

sRec = AnyRS.Fields(1).Value

nItem = AnyRS.Fields(0).Value

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.AddItem. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.AddItem(sRec)

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.NewIndex. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.ItemData. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.ItemData(AnyBox.NewIndex) = nItem

sRec = ""

nItem = 0

Else

'UPGRADE_WARNING: Use of Null/IsNull() detected. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1049"'

If Not IsDbNull(AnyRS.Fields(0).Value) Then

sRec = AnyRS.Fields(0).Value

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.AddItem. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.AddItem(sRec)

sRec = ""

End If

End If

AnyRS.MoveNext()

Loop

End If

Thanks

Dib

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Dib,

I tried it using ADODB however it was a lot of work, therefore I stopped,
using ADONET is probably more simple.

Just typed here so see it as a kind of pseudo.
\\\
Dim dt as datatable
dim conn as new XXXconnection("connectionstring see the link bellow")
dim da as new XXXdataadapter("your SQLSTRING",conn)
da.fill(dt)
AnyBox.datasource = dt
AnyBox.displaymember = "Your dbRecName" 'This is case sensitive
AnyBox.valuemember = "Your dbItemName" 'As well case sensitive
///
for the connectionstring
http://www.connectionstrings.com/

XXX stends with SQL server for SQLclient.SQL and with the rest for
OleDB.OleDB

Why not try it?

Cor

"Dib" <dN************@conNOSPAMsoftware.com>
Hi,

This code is in VB 6 I have converted the code into DOT net 2003.

I need to change this code and some Listbox and combobox.
here is my funvtion code.

If AnyRS.BOF And rs.EOF = True Then Exit Sub

'UPGRADE_WARNING: TypeOf has a new behavior. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1041"'

If TypeOf AnyBox Is System.Windows.Forms.ComboBox Or TypeOf AnyBox Is
System.Windows.Forms.ListBox Then

AnyRS.MoveFirst()

Do Until AnyRS.EOF

If AnyRS.Fields.Count > 1 Then

sRec = AnyRS.Fields(1).Value

nItem = AnyRS.Fields(0).Value

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.AddItem. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.AddItem(sRec)

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.NewIndex. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.ItemData. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.ItemData(AnyBox.NewIndex) = nItem

sRec = ""

nItem = 0

Else

'UPGRADE_WARNING: Use of Null/IsNull() detected. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1049"'

If Not IsDbNull(AnyRS.Fields(0).Value) Then

sRec = AnyRS.Fields(0).Value

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.AddItem. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.AddItem(sRec)

sRec = ""

End If

End If

AnyRS.MoveNext()

Loop

End If

Thanks

Dib


Nov 21 '05 #2

P: n/a
Dib
Thanks for your help

Dib

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uu****************@TK2MSFTNGP12.phx.gbl...
Dib,

I tried it using ADODB however it was a lot of work, therefore I stopped,
using ADONET is probably more simple.

Just typed here so see it as a kind of pseudo.
\\\
Dim dt as datatable
dim conn as new XXXconnection("connectionstring see the link bellow")
dim da as new XXXdataadapter("your SQLSTRING",conn)
da.fill(dt)
AnyBox.datasource = dt
AnyBox.displaymember = "Your dbRecName" 'This is case sensitive
AnyBox.valuemember = "Your dbItemName" 'As well case sensitive
///
for the connectionstring
http://www.connectionstrings.com/

XXX stends with SQL server for SQLclient.SQL and with the rest for
OleDB.OleDB

Why not try it?

Cor

"Dib" <dN************@conNOSPAMsoftware.com>
Hi,

This code is in VB 6 I have converted the code into DOT net 2003.

I need to change this code and some Listbox and combobox.
here is my funvtion code.

If AnyRS.BOF And rs.EOF = True Then Exit Sub

'UPGRADE_WARNING: TypeOf has a new behavior. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1041"'

If TypeOf AnyBox Is System.Windows.Forms.ComboBox Or TypeOf AnyBox Is
System.Windows.Forms.ListBox Then

AnyRS.MoveFirst()

Do Until AnyRS.EOF

If AnyRS.Fields.Count > 1 Then

sRec = AnyRS.Fields(1).Value

nItem = AnyRS.Fields(0).Value

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.AddItem. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.AddItem(sRec)

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.NewIndex. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.ItemData. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.ItemData(AnyBox.NewIndex) = nItem

sRec = ""

nItem = 0

Else

'UPGRADE_WARNING: Use of Null/IsNull() detected. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1049"'

If Not IsDbNull(AnyRS.Fields(0).Value) Then

sRec = AnyRS.Fields(0).Value

'UPGRADE_WARNING: Couldn't resolve default property of object
AnyBox.AddItem. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'

AnyBox.AddItem(sRec)

sRec = ""

End If

End If

AnyRS.MoveNext()

Loop

End If

Thanks

Dib



Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.