Home All Groups Group Topic Archive Search About

VB.NET newbie access to SQL Server

Author
26 Aug 2005 4:30 AM
SJ
Hi all,
I know this is a SQL group and I now apologise for posting in the "wrong'
group, but I had difficulty tracking down the "suitable" group.

I thought that a lot of people here would be able to help me.

To my question.

I'm learning VB.net from scratch myself with no "official" help.   I'd like
to know a suitable way to dynamically link a grid control to a SQL query
(multiple tables) in a WinForms app.

Scenario is,

Get parameters from check boxes and Combo boxes (I think I worked them out,
but any neat tricks very welcome) as parameters to the SQL query and
populate the grid.

Maybe some code or a pointer to an article or just a pointer to the correct
group.

Thanks in advance.

PS.  i'm not a newbie to programming but the articles I found leave a few
things out that i'm not up to speed with.

Author
26 Aug 2005 7:04 AM
Jose G. de Jesus Jr MCP, MCDBA
this is just a pseudo code.
it can give you ideas though
you can try http://msdn.ph/forums
got to developer section/vb.net
thanks see you there.




imports system.data.sqlclient

dim conn as new connection
conn.connectionsting="your connectionstring here"
conn.open

dim da as new dataadapter

     dim cmd as new sqlccommand
     cmd.commandtext="myproc"
     cmd.commandtype="stored proc"

            dim param as new sqlparameter
            param.direction="in"
            param.name="@SQLVARIABLE"
            param.value="hello earth"

     cmd.parameters.add(param)
da.selectcommand=cmd

dim ds as new dataset

da.fill(dst)

datagrid1.datasource=ds












--


Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787


Show quote
"SJ" wrote:

> Hi all,
> I know this is a SQL group and I now apologise for posting in the "wrong'
> group, but I had difficulty tracking down the "suitable" group.
>
> I thought that a lot of people here would be able to help me.
>
> To my question.
>
> I'm learning VB.net from scratch myself with no "official" help.   I'd like
> to know a suitable way to dynamically link a grid control to a SQL query
> (multiple tables) in a WinForms app.
>
> Scenario is,
>
> Get parameters from check boxes and Combo boxes (I think I worked them out,
> but any neat tricks very welcome) as parameters to the SQL query and
> populate the grid.
>
> Maybe some code or a pointer to an article or just a pointer to the correct
> group.
>
> Thanks in advance.
>
> PS.  i'm not a newbie to programming but the articles I found leave a few
> things out that i'm not up to speed with.
>
>
>
>
Author
26 Aug 2005 1:48 PM
JT
I don't have time to give you a fish, but here are a couple of fishing
poles:
http://msdn.microsoft.com/smartclient/community/wffaq/data.aspx
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313482

Show quote
"SJ" <myoc***@hotmail.com> wrote in message
news:sVwPe.5976$iM2.586053@news.xtra.co.nz...
> Hi all,
> I know this is a SQL group and I now apologise for posting in the "wrong'
> group, but I had difficulty tracking down the "suitable" group.
>
> I thought that a lot of people here would be able to help me.
>
> To my question.
>
> I'm learning VB.net from scratch myself with no "official" help.   I'd
> like to know a suitable way to dynamically link a grid control to a SQL
> query (multiple tables) in a WinForms app.
>
> Scenario is,
>
> Get parameters from check boxes and Combo boxes (I think I worked them
> out, but any neat tricks very welcome) as parameters to the SQL query and
> populate the grid.
>
> Maybe some code or a pointer to an article or just a pointer to the
> correct group.
>
> Thanks in advance.
>
> PS.  i'm not a newbie to programming but the articles I found leave a few
> things out that i'm not up to speed with.
>
>
>

AddThis Social Bookmark Button