All,

I would love an answer to this issue...

I am trying to populate a combo using DataSets in an n-tier model. I have
the function in the form called FillCombo send the SQL paramters to a
support DLL. The support DLL in turn calls the data layer to actually
retrieve the data from the database. What I need to be able to do is pass
the DataSet from the data layer through the support layer to the
presentation layer. I am stepping through the code and see the data populate
at the data layer. I cannot see if it is getting through from there though.

ComboBox1.DataSource = objSupport.FillCtl(sSQL) (returns a dataset)

Public Function FillCtl(sSQL...) as Dataset
...
ds = objDB.RecordGet(sSQL)
FillCtl = ds.copy

...


Anyone have any examples or suggestions? I have tried populating the DataSet
using a DataAdapter, then using .copy to copy the dataset to the function so
it gets returned. This is not working...

Thanks,
Bruce

Re: Populating a combo using n-Tier datasets by Wayne

Wayne
Tue Jul 08 09:13:14 CDT 2003

This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C34528.C768D310
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Two things that I can think of..

1) do you have the line : ComboBox1.DataBind() ?

2) if your SQL statement returns more that one table than you need to =
tell the combobox which table you want to bind..

I this helps..


Wayne=20
"Bruce Parr" <bparr@fulltilt.com> wrote in message =
news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl...
All,

I would love an answer to this issue...

I am trying to populate a combo using DataSets in an n-tier model. I =
have
the function in the form called FillCombo send the SQL paramters to a
support DLL. The support DLL in turn calls the data layer to actually
retrieve the data from the database. What I need to be able to do is =
pass
the DataSet from the data layer through the support layer to the
presentation layer. I am stepping through the code and see the data =
populate
at the data layer. I cannot see if it is getting through from there =
though.

ComboBox1.DataSource =3D objSupport.FillCtl(sSQL) (returns a dataset)

Public Function FillCtl(sSQL...) as Dataset
...
ds =3D objDB.RecordGet(sSQL)
FillCtl =3D ds.copy

...


Anyone have any examples or suggestions? I have tried populating the =
DataSet
using a DataAdapter, then using .copy to copy the dataset to the =
function so
it gets returned. This is not working...

Thanks,
Bruce




------=_NextPart_000_000E_01C34528.C768D310
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Two things that I can think =
of..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1) do you have the line :=20
ComboBox1.DataBind()&nbsp;&nbsp; ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>2) if your SQL statement returns more =
that one=20
table than you need to tell the combobox which table you want to=20
bind..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I this helps..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Wayne </FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bruce Parr" &lt;<A=20
href=3D"mailto:bparr@fulltilt.com">bparr@fulltilt.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl">news:eFg3kiVRDHA.940@T=
K2MSFTNGP11.phx.gbl</A>...</DIV>All,<BR><BR>I=20
would love an answer to this issue...<BR><BR>I am trying to populate a =
combo=20
using DataSets in an n-tier model. I have<BR>the function in the form =
called=20
FillCombo send the SQL paramters to a<BR>support DLL. The support DLL =
in turn=20
calls the data layer to actually<BR>retrieve the data from the =
database. What=20
I need to be able to do is pass<BR>the DataSet from the data layer =
through the=20
support layer to the<BR>presentation layer. I am stepping through the =
code and=20
see the data populate<BR>at the data layer. I cannot see if it is =
getting=20
through from there though.<BR><BR>ComboBox1.DataSource =3D=20
objSupport.FillCtl(sSQL) (returns a dataset)<BR><BR>Public Function=20
FillCtl(sSQL...) as Dataset<BR>&nbsp;&nbsp;&nbsp; =
...<BR>&nbsp;&nbsp;&nbsp; ds=20
=3D objDB.RecordGet(sSQL)<BR>&nbsp;&nbsp;&nbsp; FillCtl =3D=20
ds.copy<BR><BR>&nbsp;&nbsp;&nbsp; ...<BR><BR><BR>Anyone have any =
examples or=20
suggestions? I have tried populating the DataSet<BR>using a =
DataAdapter, then=20
using .copy to copy the dataset to the function so<BR>it gets =
returned. This=20
is not=20
working...<BR><BR>Thanks,<BR>Bruce<BR><BR><BR><BR></BLOCKQUOTE></BODY></H=
TML>

------=_NextPart_000_000E_01C34528.C768D310--


Re: Populating a combo using n-Tier datasets by IbrahimMalluf

IbrahimMalluf
Tue Jul 08 09:43:38 CDT 2003

Hello Bruce



Yes you can pass a dataset across tiers. I have been doing so for some time
now, including through tcp remoting.





Be aware that you do not have to use a dataset, you could use the lighter
DataTable for the same purpose.





Here is an example of my data tier code:



Public Overloads Function GetPersons(ByVal PersonFilter As clsPersonsFilter)
As DataSet



Dim objAdapter As New SqlClient.SqlDataAdapter

Dim objMyData As New DataSet

Dim objCommand As SqlClient.SqlCommand



Try

'======================================================

'always make sure the connection is open regardless of

'who owns the connection object

'======================================================

If Me._objConnect.State = ConnectionState.Closed Then

Me._objConnect.Open()

End If

objCommand = Me._objDataCMDs.GetPersonCMD(PersonFilter)

objCommand.Connection = Me._objConnect

objAdapter.SelectCommand = objCommand

objAdapter.Fill(objMyData)

Return objMyData



Catch ex As Exception

Throw ex

Finally

'=====================================================

'Make sure all local objects are properly disposed of

'=====================================================

objAdapter.Dispose()

objAdapter = Nothing

objCommand.Dispose()

objCommand = Nothing

objMyData.Dispose()

objMyData = Nothing

End Try



End Function





The function above is called by a middle tier function below. The
clsPersons class contains the function being called.



Public Overloads Function GetPersons(ByVal PersonFilter As clsPersonsFilter)
As DataSet



Try

PersonsData = New clsPersons

Return PersonsData.GetPersons(PersonFilter, Me._Connect)



Catch ex As Exception

Throw ex

Finally

PersonsData = Nothing

End Try



End Function





The above function is in turn called by any other middle tier class or
presentation layer class to get a dataset filled with rows. In your case,
to just populate a combo, use DataTable objects in place of DataSet objects.
And yes, the code above is part of a system that uses net remoting over a
tcp connection.





Ibrahim Malluf








"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl...
> All,
>
> I would love an answer to this issue...
>
> I am trying to populate a combo using DataSets in an n-tier model. I have
> the function in the form called FillCombo send the SQL paramters to a
> support DLL. The support DLL in turn calls the data layer to actually
> retrieve the data from the database. What I need to be able to do is pass
> the DataSet from the data layer through the support layer to the
> presentation layer. I am stepping through the code and see the data
populate
> at the data layer. I cannot see if it is getting through from there
though.
>
> ComboBox1.DataSource = objSupport.FillCtl(sSQL) (returns a dataset)
>
> Public Function FillCtl(sSQL...) as Dataset
> ...
> ds = objDB.RecordGet(sSQL)
> FillCtl = ds.copy
>
> ...
>
>
> Anyone have any examples or suggestions? I have tried populating the
DataSet
> using a DataAdapter, then using .copy to copy the dataset to the function
so
> it gets returned. This is not working...
>
> Thanks,
> Bruce
>
>
>
>



Re: Populating a combo using n-Tier datasets by Bruce

Bruce
Tue Jul 08 09:57:18 CDT 2003

OK guys,

I have two replies, both of which I really appreciate.

Wayne, there is no databind since I am using this for win32, not web.
Ibrahim, I am following almost exactly whayt you are doing, but can't seem
to get the combo to populate. Not sure why yet...Code is all below

***Presentation***
Private Sub FillStudents()

Dim objSupport As EGI.Support
Dim ds As New DataSet()

ComboBox1.ValueMember = "StudentID"
ComboBox1.DisplayMember = "FullName"
objSupport = New EGI.Support(True, "", gs_SQLConnString)
ds = objSupport.FillCtlCbo("STU_Students", "FullName", "StudentID",
ComboBox1)
ComboBox1.DataSource = ds
objSupport = Nothing

End Sub

***Support***

Public Function FillCtlCbo(ByVal sTblName As String, ByVal sFldName As
String, ByVal sIDName As String, ByVal sCboName As ComboBox, Optional ByVal
sUserID As String = "") As DataSet
Dim objCtl As DataHandler
Dim strSQl As String
Dim ds As New DataSet()

objCtl = New DataHandler(cblnIsSQL, cstrAccessDB, cstrSQLConnectionString)

strSQl = ""
If sTblName = "STU_Students" Then
strSQl = "SELECT [" & sIDName & "], [" & sFldName & "], MiddleName FROM
" & sTblName
strSQl = strSQl & " ORDER BY [" & sFldName & "]"
Else
strSQl = "SELECT [" & sIDName & "], [" & sFldName & "] FROM " & sTblName
strSQl = strSQl & " ORDER BY [" & sFldName & "]"
End If

ds = objCtl.RecordGetDS(strSQl)
If Not objCtl Is Nothing Then
objCtl.Dispose()
objCtl = Nothing
End If

If Not rstCtl Is Nothing Then rstCtl = Nothing
Return ds

End Function

***Data***

Public Function RecordGetDS(ByVal sSQL As String) As DataSet
Dim objConn As OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet()

'**** Connect to Database

objConn = New OleDb.OleDbConnection()
If Not cblnIsSQL Then
objConn.ConnectionString = GetConnectionString(cstrAccessDB)
objConn.Open()
Else
objConn.ConnectionString = cstrSQLConnectionString
sSQL = Replace(sSQL, "= True", "= 1", 1)
sSQL = Replace(sSQL, "=True", "=1", 1)
sSQL = Replace(sSQL, "= False", "= 0", 1)
sSQL = Replace(sSQL, "=False", "=0", 1)
sSQL = Replace(sSQL, "=#", "='", 1)
sSQL = Replace(sSQL, "<#", "<'", 1)
sSQL = Replace(sSQL, ">#", ">'", 1)
sSQL = Replace(sSQL, "= #", "= '", 1)
sSQL = Replace(sSQL, "< #", "< '", 1)
sSQL = Replace(sSQL, "> #", "> '", 1)
sSQL = Replace(sSQL, ",#", ",'", 1)
sSQL = Replace(sSQL, ", #", ", '", 1)
sSQL = Replace(sSQL, "#,", "',", 1)
sSQL = Replace(sSQL, "# ", "' ", 1)

If Right(sSQL, 1) = "#" Then
sSQL = Replace(sSQL, "#", "'")
End If
End If



da = New OleDb.OleDbDataAdapter(sSQL, objConn.ConnectionString)

da.Fill(ds)

If Not objConn Is Nothing Then
objConn.Close()
objConn.Dispose()
objConn = Nothing
End If

If Not da Is Nothing Then
da.Dispose()
da = Nothing
End If

Return ds

End Function


"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl...
> All,
>
> I would love an answer to this issue...
>
> I am trying to populate a combo using DataSets in an n-tier model. I have
> the function in the form called FillCombo send the SQL paramters to a
> support DLL. The support DLL in turn calls the data layer to actually
> retrieve the data from the database. What I need to be able to do is pass
> the DataSet from the data layer through the support layer to the
> presentation layer. I am stepping through the code and see the data
populate
> at the data layer. I cannot see if it is getting through from there
though.
>
> ComboBox1.DataSource = objSupport.FillCtl(sSQL) (returns a dataset)
>
> Public Function FillCtl(sSQL...) as Dataset
> ...
> ds = objDB.RecordGet(sSQL)
> FillCtl = ds.copy
>
> ...
>
>
> Anyone have any examples or suggestions? I have tried populating the
DataSet
> using a DataAdapter, then using .copy to copy the dataset to the function
so
> it gets returned. This is not working...
>
> Thanks,
> Bruce
>
>
>
>



Re: Populating a combo using n-Tier datasets by Wayne

Wayne
Tue Jul 08 14:56:37 CDT 2003

This is a multi-part message in MIME format.

------=_NextPart_000_00FF_01C34558.BFDFA710
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

In my code that I use to populate Comboboxes I have the following lines =
:

ComboBox1.BeginUpdate()
ComboBox1.DataSource =3D ....
ComboBox1.ValueMember =3D ...
ComboBox1.DisplayMember =3D ...
ComboBox1.EndUpdate()

Are you not able to see the contents of your dataset when it comes out =
of FillCtlCbo?

Wayne=20


"Bruce Parr" <bparr@fulltilt.com> wrote in message =
news:%23D8iwFWRDHA.2148@TK2MSFTNGP11.phx.gbl...
OK guys,

I have two replies, both of which I really appreciate.

Wayne, there is no databind since I am using this for win32, not web.
Ibrahim, I am following almost exactly whayt you are doing, but can't =
seem
to get the combo to populate. Not sure why yet...Code is all below

***Presentation***
Private Sub FillStudents()

Dim objSupport As EGI.Support
Dim ds As New DataSet()

ComboBox1.ValueMember =3D "StudentID"
ComboBox1.DisplayMember =3D "FullName"
objSupport =3D New EGI.Support(True, "", gs_SQLConnString)
ds =3D objSupport.FillCtlCbo("STU_Students", "FullName", "StudentID",
ComboBox1)
ComboBox1.DataSource =3D ds
objSupport =3D Nothing

End Sub

***Support***

Public Function FillCtlCbo(ByVal sTblName As String, ByVal sFldName As
String, ByVal sIDName As String, ByVal sCboName As ComboBox, Optional =
ByVal
sUserID As String =3D "") As DataSet
Dim objCtl As DataHandler
Dim strSQl As String
Dim ds As New DataSet()

objCtl =3D New DataHandler(cblnIsSQL, cstrAccessDB, =
cstrSQLConnectionString)

strSQl =3D ""
If sTblName =3D "STU_Students" Then
strSQl =3D "SELECT [" & sIDName & "], [" & sFldName & "], =
MiddleName FROM
" & sTblName
strSQl =3D strSQl & " ORDER BY [" & sFldName & "]"
Else
strSQl =3D "SELECT [" & sIDName & "], [" & sFldName & "] FROM " & =
sTblName
strSQl =3D strSQl & " ORDER BY [" & sFldName & "]"
End If

ds =3D objCtl.RecordGetDS(strSQl)
If Not objCtl Is Nothing Then
objCtl.Dispose()
objCtl =3D Nothing
End If

If Not rstCtl Is Nothing Then rstCtl =3D Nothing
Return ds

End Function

***Data***

Public Function RecordGetDS(ByVal sSQL As String) As DataSet
Dim objConn As OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet()

'**** Connect to Database

objConn =3D New OleDb.OleDbConnection()
If Not cblnIsSQL Then
objConn.ConnectionString =3D GetConnectionString(cstrAccessDB)
objConn.Open()
Else
objConn.ConnectionString =3D cstrSQLConnectionString
sSQL =3D Replace(sSQL, "=3D True", "=3D 1", 1)
sSQL =3D Replace(sSQL, "=3DTrue", "=3D1", 1)
sSQL =3D Replace(sSQL, "=3D False", "=3D 0", 1)
sSQL =3D Replace(sSQL, "=3DFalse", "=3D0", 1)
sSQL =3D Replace(sSQL, "=3D#", "=3D'", 1)
sSQL =3D Replace(sSQL, "<#", "<'", 1)
sSQL =3D Replace(sSQL, ">#", ">'", 1)
sSQL =3D Replace(sSQL, "=3D #", "=3D '", 1)
sSQL =3D Replace(sSQL, "< #", "< '", 1)
sSQL =3D Replace(sSQL, "> #", "> '", 1)
sSQL =3D Replace(sSQL, ",#", ",'", 1)
sSQL =3D Replace(sSQL, ", #", ", '", 1)
sSQL =3D Replace(sSQL, "#,", "',", 1)
sSQL =3D Replace(sSQL, "# ", "' ", 1)

If Right(sSQL, 1) =3D "#" Then
sSQL =3D Replace(sSQL, "#", "'")
End If
End If



da =3D New OleDb.OleDbDataAdapter(sSQL, objConn.ConnectionString)

da.Fill(ds)

If Not objConn Is Nothing Then
objConn.Close()
objConn.Dispose()
objConn =3D Nothing
End If

If Not da Is Nothing Then
da.Dispose()
da =3D Nothing
End If

Return ds

End Function


"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl...
> All,
>
> I would love an answer to this issue...
>
> I am trying to populate a combo using DataSets in an n-tier model. I =
have
> the function in the form called FillCombo send the SQL paramters to =
a
> support DLL. The support DLL in turn calls the data layer to =
actually
> retrieve the data from the database. What I need to be able to do is =
pass
> the DataSet from the data layer through the support layer to the
> presentation layer. I am stepping through the code and see the data
populate
> at the data layer. I cannot see if it is getting through from there
though.
>
> ComboBox1.DataSource =3D objSupport.FillCtl(sSQL) (returns a =
dataset)
>
> Public Function FillCtl(sSQL...) as Dataset
> ...
> ds =3D objDB.RecordGet(sSQL)
> FillCtl =3D ds.copy
>
> ...
>
>
> Anyone have any examples or suggestions? I have tried populating the
DataSet
> using a DataAdapter, then using .copy to copy the dataset to the =
function
so
> it gets returned. This is not working...
>
> Thanks,
> Bruce
>
>
>
>


------=_NextPart_000_00FF_01C34558.BFDFA710
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>In my code that I use to populate =
Comboboxes I have=20
the following lines :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ComboBox1.BeginUpdate()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ComboBox1.DataSource =3D =
....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ComboBox1.ValueMember =3D =
...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ComboBox1.DisplayMember =3D =
...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ComboBox1.EndUpdate()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Are you not able to see the contents of =
your=20
dataset when it comes out of <FONT face=3D"Times New Roman"=20
size=3D3>FillCtlCbo?</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Times New Roman"=20
size=3D3></FONT>&nbsp;</DIV></FONT>
<DIV><FONT face=3DVerdana size=3D2>Wayne </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2><BR>&nbsp;</DIV></FONT>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bruce Parr" &lt;<A=20
href=3D"mailto:bparr@fulltilt.com">bparr@fulltilt.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:%23D8iwFWRDHA.2148@TK2MSFTNGP11.phx.gbl">news:%23D8iwFWRDHA.=
2148@TK2MSFTNGP11.phx.gbl</A>...</DIV>OK=20
guys,<BR><BR>I have two replies, both of which I really=20
appreciate.<BR><BR>Wayne, there is no databind since I am using this =
for=20
win32, not web.<BR>Ibrahim, I am following almost exactly whayt you =
are doing,=20
but can't seem<BR>to get the combo to populate. Not sure why =
yet...Code is all=20
below<BR><BR>***Presentation***<BR>Private Sub =
FillStudents()<BR><BR>Dim=20
objSupport As EGI.Support<BR>Dim ds As New=20
DataSet()<BR><BR>ComboBox1.ValueMember =3D=20
"StudentID"<BR>ComboBox1.DisplayMember =3D "FullName"<BR>objSupport =
=3D New=20
EGI.Support(True, "", gs_SQLConnString)<BR>ds =3D=20
objSupport.FillCtlCbo("STU_Students", "FullName",=20
"StudentID",<BR>ComboBox1)<BR>ComboBox1.DataSource =3D =
ds<BR>objSupport =3D=20
Nothing<BR><BR>End Sub<BR><BR>***Support***<BR><BR>Public Function=20
FillCtlCbo(ByVal sTblName As String, ByVal sFldName As<BR>String, =
ByVal=20
sIDName As String, ByVal sCboName As ComboBox, Optional =
ByVal<BR>sUserID As=20
String =3D "") As DataSet<BR>Dim objCtl As DataHandler<BR>Dim strSQl =
As=20
String<BR>Dim ds As New DataSet()<BR><BR>objCtl =3D New =
DataHandler(cblnIsSQL,=20
cstrAccessDB, cstrSQLConnectionString)<BR><BR>strSQl =3D ""<BR>If =
sTblName =3D=20
"STU_Students" Then<BR>&nbsp;&nbsp;&nbsp; strSQl =3D "SELECT [" &amp; =
sIDName=20
&amp; "], [" &amp; sFldName &amp; "], MiddleName FROM<BR>" &amp;=20
sTblName<BR>&nbsp;&nbsp;&nbsp; strSQl =3D strSQl &amp; " ORDER BY [" =
&amp;=20
sFldName &amp; "]"<BR>Else<BR>&nbsp;&nbsp;&nbsp; strSQl =3D "SELECT [" =
&amp;=20
sIDName &amp; "], [" &amp; sFldName &amp; "] FROM " &amp;=20
sTblName<BR>&nbsp;&nbsp;&nbsp; strSQl =3D strSQl &amp; " ORDER BY [" =
&amp;=20
sFldName &amp; "]"<BR>End If<BR><BR>ds =3D =
objCtl.RecordGetDS(strSQl)<BR>If Not=20
objCtl Is Nothing Then<BR>&nbsp;&nbsp;&nbsp;=20
objCtl.Dispose()<BR>&nbsp;&nbsp;&nbsp; objCtl =3D Nothing<BR>End =
If<BR><BR>If=20
Not rstCtl Is Nothing Then rstCtl =3D Nothing<BR>Return ds<BR><BR>End=20
Function<BR><BR>***Data***<BR><BR>Public Function RecordGetDS(ByVal =
sSQL As=20
String) As DataSet<BR>Dim objConn As OleDb.OleDbConnection<BR>Dim da =
As=20
OleDb.OleDbDataAdapter<BR>Dim ds As New DataSet()<BR><BR>'**** Connect =
to=20
Database<BR><BR>objConn =3D New OleDb.OleDbConnection()<BR>If Not =
cblnIsSQL=20
Then<BR>&nbsp;&nbsp;&nbsp; objConn.ConnectionString =3D=20
GetConnectionString(cstrAccessDB)<BR>&nbsp;&nbsp;&nbsp;=20
objConn.Open()<BR>Else<BR>&nbsp;&nbsp;&nbsp; objConn.ConnectionString =
=3D=20
cstrSQLConnectionString<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, =
"=3D True",=20
"=3D 1", 1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "=3DTrue", =
"=3D1",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "=3D False", "=3D 0",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "=3DFalse", "=3D0",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "=3D#", "=3D'",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "&lt;#", "&lt;'",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "&gt;#", "&gt;'",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "=3D #", "=3D '",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "&lt; #", "&lt; '",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "&gt; #", "&gt; '",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, ",#", ",'",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, ", #", ", '",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "#,", "',",=20
1)<BR>&nbsp;&nbsp;&nbsp; sSQL =3D Replace(sSQL, "# ", "' ",=20
1)<BR><BR>&nbsp;&nbsp;&nbsp; If Right(sSQL, 1) =3D "#"=20
Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sSQL =3D =
Replace(sSQL, "#",=20
"'")<BR>&nbsp;&nbsp;&nbsp; End If<BR>End If<BR><BR><BR><BR>da =3D New=20
OleDb.OleDbDataAdapter(sSQL,=20
objConn.ConnectionString)<BR><BR>da.Fill(ds)<BR><BR>If Not objConn Is =
Nothing=20
Then<BR>&nbsp;&nbsp;&nbsp; objConn.Close()<BR>&nbsp;&nbsp;&nbsp;=20
objConn.Dispose()<BR>&nbsp;&nbsp;&nbsp; objConn =3D Nothing<BR>End =
If<BR><BR>If=20
Not da Is Nothing Then<BR>&nbsp;&nbsp;&nbsp;=20
da.Dispose()<BR>&nbsp;&nbsp;&nbsp; da =3D Nothing<BR>End =
If<BR><BR>Return=20
ds<BR><BR>End Function<BR><BR><BR>"Bruce Parr" &lt;<A=20
href=3D"mailto:bparr@fulltilt.com">bparr@fulltilt.com</A>&gt; wrote in =

message<BR><A=20
=
href=3D"news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl">news:eFg3kiVRDHA.940@T=
K2MSFTNGP11.phx.gbl</A>...<BR>&gt;=20
All,<BR>&gt;<BR>&gt; I would love an answer to this =
issue...<BR>&gt;<BR>&gt; I=20
am trying to populate a combo using DataSets in an n-tier model. I=20
have<BR>&gt; the function in the form called FillCombo send the SQL =
paramters=20
to a<BR>&gt; support DLL. The support DLL in turn calls the data layer =
to=20
actually<BR>&gt; retrieve the data from the database. What I need to =
be able=20
to do is pass<BR>&gt; the DataSet from the data layer through the =
support=20
layer to the<BR>&gt; presentation layer. I am stepping through the =
code and=20
see the data<BR>populate<BR>&gt; at the data layer. I cannot see if it =
is=20
getting through from there<BR>though.<BR>&gt;<BR>&gt; =
ComboBox1.DataSource =3D=20
objSupport.FillCtl(sSQL) (returns a dataset)<BR>&gt;<BR>&gt; Public =
Function=20
FillCtl(sSQL...) as Dataset<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=20
...<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ds =3D=20
objDB.RecordGet(sSQL)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; FillCtl =3D=20
ds.copy<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; =
...<BR>&gt;<BR>&gt;<BR>&gt;=20
Anyone have any examples or suggestions? I have tried populating=20
the<BR>DataSet<BR>&gt; using a DataAdapter, then using .copy to copy =
the=20
dataset to the function<BR>so<BR>&gt; it gets returned. This is not=20
working...<BR>&gt;<BR>&gt; Thanks,<BR>&gt;=20
=
Bruce<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00FF_01C34558.BFDFA710--


Re: Populating a combo using n-Tier datasets by Bruce

Bruce
Tue Jul 08 17:20:35 CDT 2003

Wayne,

I found the issue. I was trying to assign a dataset directly instead of
passing a dataset to a dataview and assigning the dataview to the
datasource. It took me a while to figure it out, but once I found the way to
output the dataset to an xml file to see if it was being passed in each
place, I got it running.

Now if I can just figure out how to disconnect the connection to the
database between calls, I'll be REALLY happy.

Thanks for your help!

Take care,
Bruce

"Wayne" <nospam_wvaneck@nwgeo.com> wrote in message
news:#Y1v7vYRDHA.632@TK2MSFTNGP12.phx.gbl...
In my code that I use to populate Comboboxes I have the following lines :

ComboBox1.BeginUpdate()
ComboBox1.DataSource = ....
ComboBox1.ValueMember = ...
ComboBox1.DisplayMember = ...
ComboBox1.EndUpdate()

Are you not able to see the contents of your dataset when it comes out of
FillCtlCbo?

Wayne


"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:%23D8iwFWRDHA.2148@TK2MSFTNGP11.phx.gbl...
OK guys,

I have two replies, both of which I really appreciate.

Wayne, there is no databind since I am using this for win32, not web.
Ibrahim, I am following almost exactly whayt you are doing, but can't seem
to get the combo to populate. Not sure why yet...Code is all below

***Presentation***
Private Sub FillStudents()

Dim objSupport As EGI.Support
Dim ds As New DataSet()

ComboBox1.ValueMember = "StudentID"
ComboBox1.DisplayMember = "FullName"
objSupport = New EGI.Support(True, "", gs_SQLConnString)
ds = objSupport.FillCtlCbo("STU_Students", "FullName", "StudentID",
ComboBox1)
ComboBox1.DataSource = ds
objSupport = Nothing

End Sub

***Support***

Public Function FillCtlCbo(ByVal sTblName As String, ByVal sFldName As
String, ByVal sIDName As String, ByVal sCboName As ComboBox, Optional ByVal
sUserID As String = "") As DataSet
Dim objCtl As DataHandler
Dim strSQl As String
Dim ds As New DataSet()

objCtl = New DataHandler(cblnIsSQL, cstrAccessDB, cstrSQLConnectionString)

strSQl = ""
If sTblName = "STU_Students" Then
strSQl = "SELECT [" & sIDName & "], [" & sFldName & "], MiddleName FROM
" & sTblName
strSQl = strSQl & " ORDER BY [" & sFldName & "]"
Else
strSQl = "SELECT [" & sIDName & "], [" & sFldName & "] FROM " & sTblName
strSQl = strSQl & " ORDER BY [" & sFldName & "]"
End If

ds = objCtl.RecordGetDS(strSQl)
If Not objCtl Is Nothing Then
objCtl.Dispose()
objCtl = Nothing
End If

If Not rstCtl Is Nothing Then rstCtl = Nothing
Return ds

End Function

***Data***

Public Function RecordGetDS(ByVal sSQL As String) As DataSet
Dim objConn As OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet()

'**** Connect to Database

objConn = New OleDb.OleDbConnection()
If Not cblnIsSQL Then
objConn.ConnectionString = GetConnectionString(cstrAccessDB)
objConn.Open()
Else
objConn.ConnectionString = cstrSQLConnectionString
sSQL = Replace(sSQL, "= True", "= 1", 1)
sSQL = Replace(sSQL, "=True", "=1", 1)
sSQL = Replace(sSQL, "= False", "= 0", 1)
sSQL = Replace(sSQL, "=False", "=0", 1)
sSQL = Replace(sSQL, "=#", "='", 1)
sSQL = Replace(sSQL, "<#", "<'", 1)
sSQL = Replace(sSQL, ">#", ">'", 1)
sSQL = Replace(sSQL, "= #", "= '", 1)
sSQL = Replace(sSQL, "< #", "< '", 1)
sSQL = Replace(sSQL, "> #", "> '", 1)
sSQL = Replace(sSQL, ",#", ",'", 1)
sSQL = Replace(sSQL, ", #", ", '", 1)
sSQL = Replace(sSQL, "#,", "',", 1)
sSQL = Replace(sSQL, "# ", "' ", 1)

If Right(sSQL, 1) = "#" Then
sSQL = Replace(sSQL, "#", "'")
End If
End If



da = New OleDb.OleDbDataAdapter(sSQL, objConn.ConnectionString)

da.Fill(ds)

If Not objConn Is Nothing Then
objConn.Close()
objConn.Dispose()
objConn = Nothing
End If

If Not da Is Nothing Then
da.Dispose()
da = Nothing
End If

Return ds

End Function


"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl...
> All,
>
> I would love an answer to this issue...
>
> I am trying to populate a combo using DataSets in an n-tier model. I have
> the function in the form called FillCombo send the SQL paramters to a
> support DLL. The support DLL in turn calls the data layer to actually
> retrieve the data from the database. What I need to be able to do is pass
> the DataSet from the data layer through the support layer to the
> presentation layer. I am stepping through the code and see the data
populate
> at the data layer. I cannot see if it is getting through from there
though.
>
> ComboBox1.DataSource = objSupport.FillCtl(sSQL) (returns a dataset)
>
> Public Function FillCtl(sSQL...) as Dataset
> ...
> ds = objDB.RecordGet(sSQL)
> FillCtl = ds.copy
>
> ...
>
>
> Anyone have any examples or suggestions? I have tried populating the
DataSet
> using a DataAdapter, then using .copy to copy the dataset to the function
so
> it gets returned. This is not working...
>
> Thanks,
> Bruce
>
>
>
>



Re: Populating a combo using n-Tier datasets by Wayne

Wayne
Tue Jul 08 17:26:03 CDT 2003

This is a multi-part message in MIME format.

------=_NextPart_000_01ED_01C3456D.9FCD9CB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Glad you got it running...

I think if you return a datatable from the FillCtlCbo function then you =
could disconnect easily.. something like this...

function FillCtlCbo (......., byref tblResult as datatable) as boolean

' ....... some stuff here

try
'..... do your SQL stuff here

tblResult =3D yourDataSet.Tables(0).Copy()

FillCtlCbo =3D True
catch=20

end try

yourDataSet.Dispose()
yourDataSet =3D nothing
end function



Wayne
"Bruce Parr" <bparr@fulltilt.com> wrote in message =
news:%23O0Po8ZRDHA.2148@TK2MSFTNGP12.phx.gbl...
Wayne,

I found the issue. I was trying to assign a dataset directly instead =
of
passing a dataset to a dataview and assigning the dataview to the
datasource. It took me a while to figure it out, but once I found the =
way to
output the dataset to an xml file to see if it was being passed in =
each
place, I got it running.

Now if I can just figure out how to disconnect the connection to the
database between calls, I'll be REALLY happy.

Thanks for your help!

Take care,
Bruce

"Wayne" <nospam_wvaneck@nwgeo.com> wrote in message
news:#Y1v7vYRDHA.632@TK2MSFTNGP12.phx.gbl...
In my code that I use to populate Comboboxes I have the following =
lines :

ComboBox1.BeginUpdate()
ComboBox1.DataSource =3D ....
ComboBox1.ValueMember =3D ...
ComboBox1.DisplayMember =3D ...
ComboBox1.EndUpdate()

Are you not able to see the contents of your dataset when it comes out =
of
FillCtlCbo?

Wayne


"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:%23D8iwFWRDHA.2148@TK2MSFTNGP11.phx.gbl...
OK guys,

I have two replies, both of which I really appreciate.

Wayne, there is no databind since I am using this for win32, not web.
Ibrahim, I am following almost exactly whayt you are doing, but can't =
seem
to get the combo to populate. Not sure why yet...Code is all below

***Presentation***
Private Sub FillStudents()

Dim objSupport As EGI.Support
Dim ds As New DataSet()

ComboBox1.ValueMember =3D "StudentID"
ComboBox1.DisplayMember =3D "FullName"
objSupport =3D New EGI.Support(True, "", gs_SQLConnString)
ds =3D objSupport.FillCtlCbo("STU_Students", "FullName", "StudentID",
ComboBox1)
ComboBox1.DataSource =3D ds
objSupport =3D Nothing

End Sub

***Support***

Public Function FillCtlCbo(ByVal sTblName As String, ByVal sFldName As
String, ByVal sIDName As String, ByVal sCboName As ComboBox, Optional =
ByVal
sUserID As String =3D "") As DataSet
Dim objCtl As DataHandler
Dim strSQl As String
Dim ds As New DataSet()

objCtl =3D New DataHandler(cblnIsSQL, cstrAccessDB, =
cstrSQLConnectionString)

strSQl =3D ""
If sTblName =3D "STU_Students" Then
strSQl =3D "SELECT [" & sIDName & "], [" & sFldName & "], =
MiddleName FROM
" & sTblName
strSQl =3D strSQl & " ORDER BY [" & sFldName & "]"
Else
strSQl =3D "SELECT [" & sIDName & "], [" & sFldName & "] FROM " & =
sTblName
strSQl =3D strSQl & " ORDER BY [" & sFldName & "]"
End If

ds =3D objCtl.RecordGetDS(strSQl)
If Not objCtl Is Nothing Then
objCtl.Dispose()
objCtl =3D Nothing
End If

If Not rstCtl Is Nothing Then rstCtl =3D Nothing
Return ds

End Function

***Data***

Public Function RecordGetDS(ByVal sSQL As String) As DataSet
Dim objConn As OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet()

'**** Connect to Database

objConn =3D New OleDb.OleDbConnection()
If Not cblnIsSQL Then
objConn.ConnectionString =3D GetConnectionString(cstrAccessDB)
objConn.Open()
Else
objConn.ConnectionString =3D cstrSQLConnectionString
sSQL =3D Replace(sSQL, "=3D True", "=3D 1", 1)
sSQL =3D Replace(sSQL, "=3DTrue", "=3D1", 1)
sSQL =3D Replace(sSQL, "=3D False", "=3D 0", 1)
sSQL =3D Replace(sSQL, "=3DFalse", "=3D0", 1)
sSQL =3D Replace(sSQL, "=3D#", "=3D'", 1)
sSQL =3D Replace(sSQL, "<#", "<'", 1)
sSQL =3D Replace(sSQL, ">#", ">'", 1)
sSQL =3D Replace(sSQL, "=3D #", "=3D '", 1)
sSQL =3D Replace(sSQL, "< #", "< '", 1)
sSQL =3D Replace(sSQL, "> #", "> '", 1)
sSQL =3D Replace(sSQL, ",#", ",'", 1)
sSQL =3D Replace(sSQL, ", #", ", '", 1)
sSQL =3D Replace(sSQL, "#,", "',", 1)
sSQL =3D Replace(sSQL, "# ", "' ", 1)

If Right(sSQL, 1) =3D "#" Then
sSQL =3D Replace(sSQL, "#", "'")
End If
End If



da =3D New OleDb.OleDbDataAdapter(sSQL, objConn.ConnectionString)

da.Fill(ds)

If Not objConn Is Nothing Then
objConn.Close()
objConn.Dispose()
objConn =3D Nothing
End If

If Not da Is Nothing Then
da.Dispose()
da =3D Nothing
End If

Return ds

End Function


"Bruce Parr" <bparr@fulltilt.com> wrote in message
news:eFg3kiVRDHA.940@TK2MSFTNGP11.phx.gbl...
> All,
>
> I would love an answer to this issue...
>
> I am trying to populate a combo using DataSets in an n-tier model. I =
have
> the function in the form called FillCombo send the SQL paramters to =
a
> support DLL. The support DLL in turn calls the data layer to =
actually
> retrieve the data from the database. What I need to be able to do is =
pass
> the DataSet from the data layer through the support layer to the
> presentation layer. I am stepping through the code and see the data
populate
> at the data layer. I cannot see if it is getting through from there
though.
>
> ComboBox1.DataSource =3D objSupport.FillCtl(sSQL) (returns a =
dataset)
>
> Public Function FillCtl(sSQL...) as Dataset
> ...
> ds =3D objDB.RecordGet(sSQL)
> FillCtl =3D ds.copy
>
> ...
>
>
> Anyone have any examples or suggestions? I have tried populating the
DataSet
> using a DataAdapter, then using .copy to copy the dataset to the =
function
so
> it gets returned. This is not working...
>
> Thanks,
> Bruce
>
>
>
>


------=_NextPart_000_01ED_01C3456D.9FCD9CB0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Glad you got it running...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think if you return a datatable from =
the <FONT=20
face=3D"Times New Roman" size=3D3>FillCtlCbo <FONT face=3DArial =
size=3D2>function then=20
you could disconnect easily.. something like =
this...</FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>function <FONT face=3D"Times New Roman" =

size=3D3>FillCtlCbo (......., byref tblResult as datatable)=20
as&nbsp;boolean</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ' ....... some stuff =

here</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; try</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
'..... do=20
your SQL stuff here</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
tblResult =3D=20
yourDataSet.Tables(0).Copy()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT=20
face=3D"Times New Roman" size=3D3>FillCtlCbo =3D =
True</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; catch </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; end try</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
yourDataSet.Dispose()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; yourDataSet =3D=20
nothing</FONT></DIV>
<DIV>end function</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Wayne</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Bruce Parr" &lt;<A=20
href=3D"mailto:bparr@fulltilt.com">bparr@fulltilt.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:%23O0Po8ZRDHA.2148@TK2MSFTNGP12.phx.gbl">news:%23O0Po8ZRDHA.=
2148@TK2MSFTNGP12.phx.gbl</A>...</DIV>Wayne,<BR><BR>I=20
found the issue. I was trying to assign a dataset directly instead=20
of<BR>passing a dataset to a dataview and assigning the dataview to=20
the<BR>datasource. It took me a while to figure it out, but once I =
found the=20
way to<BR>output the dataset to an xml file to see if it was being =
passed in=20
each<BR>place, I got it running.<BR><BR>Now if I can just figure out =
how to=20
disconnect the connection to the<BR>database between calls, I'll be =
REALLY=20
happy.<BR><BR>Thanks for your help!<BR><BR>Take =
care,<BR>Bruce<BR><BR>"Wayne"=20
&lt;<A =
href=3D"mailto:nospam_wvaneck@nwgeo.com">nospam_wvaneck@nwgeo.com</A>&gt;=
=20
wrote in message<BR><A=20
=
href=3D"news:#Y1v7vYRDHA.632@TK2MSFTNGP12.phx.gbl">news:#Y1v7vYRDHA.632@T=
K2MSFTNGP12.phx.gbl</A>...<BR>In=20
my code that I use to populate Comboboxes I have the following lines=20
:<BR><BR>ComboBox1.BeginUpdate()<BR>ComboBox1.DataSource =3D=20
....<BR>ComboBox1.ValueMember =3D ...<BR>ComboBox1.DisplayMember =3D=20
...<BR>ComboBox1.EndUpdate()<BR><BR>Are you not able to see the =
contents of=20
your dataset when it comes out=20
of<BR>FillCtlCbo?<BR><BR>Wayne<BR><BR><BR>"Bruce Parr" &lt;<A=20
href=3D"mailto:bparr@fulltilt.com">bparr@fulltilt.com</A>&gt; wrote in =

message<BR><A=20
=
href=3D"news:%23D8iwFWRDHA.2148@TK2MSFTNGP11.phx.gbl">news:%23D8iwFWRDHA.=
2148@TK2MSFTNGP11.phx.gbl</A>...<BR>OK=20
guys,<BR><BR>I have two replies, both of which I really=20
appreciate.<BR><BR>Wayne, there is no databind since I am using this =
for=20
win32, not web.<BR>Ibrahim, I am following almost exactly whayt you =
are doing,=20
but can't seem<BR>to get the combo to populate. Not sure why =
yet...Code is all=20
below<BR><BR>***Presentation***<BR>Private Sub =
FillStudents()<BR><BR>Dim=20
objSupport As EGI.Support<BR>Dim ds As New=20
DataSet()<BR><BR>ComboBox1.ValueMember =3D=20
"StudentID"<BR>ComboBox1.DisplayMember =3D "FullName"<BR>objSupport =
=3D New=20
EGI.Support(True, "", gs_SQLConnString)<BR>ds =3D=20
objSupport.FillCtlCbo("STU_Students", "FullName",=20
"StudentID",<BR>ComboBox1)<BR>ComboBox1.DataSource =3D =
ds<BR>objSupport =3D=20
Nothing<BR><BR>End Sub<BR><BR>***Support***<BR><BR>Public Function=20
FillCtlCbo(ByVal sTblName As String, ByVal sFldName As<BR>String, =
ByVal=20
sIDName As String, ByVal sCboName As ComboBox, Optional =
ByVal<BR>sUserID As=20
String =3D "") As DataSet<BR>Dim objCtl As DataHandler<BR>Dim strSQl =
As=20
String<BR>Dim ds As New DataSet()<BR><BR>objCtl =3D New =
DataHandler(cblnIsSQL,=20
cstrAccessDB, cstrSQLConnectionString)<BR><BR>strSQl =3D ""<BR>If =
sTblName =3D=20
"STU_Students" Then<BR>&nbsp;&nbsp;&nbsp; strSQl =3D "SELECT [" &amp; =
sIDName=20
&amp; "], [" &amp; sFldName &amp; "], MiddleName FROM<BR>" &amp;=20
sTblName<BR>&nbsp;&nbsp;&nbsp; strSQl =3D strSQl &amp; " ORDER BY [" =
&amp;=20
sFldName &amp; "]"<BR>Else<BR>&nbsp;&nbsp;&nbsp; strSQl =3D "SELECT [" =
&amp;=20
sIDName &amp; "], [" &amp; sFldName &amp; "] FROM " &amp;=20
sTblName<BR>&nbsp;&nbsp;&nbsp; strSQl =3D strSQl &amp; " ORDER BY [" =
&amp;=20
sFldName &amp; "]"<BR>End If<BR&g