F
fpennisi
Hi all
I have started writing a web app in Visual Studio 2005 (using c#). I
am new to both C# and Visual Studio 2005.
I will start by telling you what I need and then how I would have done
it using classic ASP previously.
What I need:
- Within Visual Studio 2005 (c#) to create a reusable function within
a file that can essentially be included in all my other pages (IE add
an include file reference from a master page - Please tell me if this
is poor coding practice).
- From my desired page I want to be able to pass a SQL command to a
function contained within the included file. The function then needs
to return a recodset (accessing a SQL database).
How I would do it in classic ASP.
For arguments sake lets say I have a standard ASP file. That page
potentially contained one or more include files. The include files
contain various functions so that I could reuse them within various
other pages (oo or modular coding).
For example:
I had a page where i wanted to display users. I would create a
standard ASP page and then using include file I would reference
functions from the included file(s). Essentially I would parse a SQL
stored procedure and its parameters or a SQL command (in a string
format) from the users page, make a connection and return a recodset.
Then draw the page as per my recordset or required.
How do I do this in C# (within visual studio 2005)?
Please suggest common/best practice methodolgies and teminology.
Providing code examples would be great.
Thanks in advance.
Fabio
I have started writing a web app in Visual Studio 2005 (using c#). I
am new to both C# and Visual Studio 2005.
I will start by telling you what I need and then how I would have done
it using classic ASP previously.
What I need:
- Within Visual Studio 2005 (c#) to create a reusable function within
a file that can essentially be included in all my other pages (IE add
an include file reference from a master page - Please tell me if this
is poor coding practice).
- From my desired page I want to be able to pass a SQL command to a
function contained within the included file. The function then needs
to return a recodset (accessing a SQL database).
How I would do it in classic ASP.
For arguments sake lets say I have a standard ASP file. That page
potentially contained one or more include files. The include files
contain various functions so that I could reuse them within various
other pages (oo or modular coding).
For example:
I had a page where i wanted to display users. I would create a
standard ASP page and then using include file I would reference
functions from the included file(s). Essentially I would parse a SQL
stored procedure and its parameters or a SQL command (in a string
format) from the users page, make a connection and return a recodset.
Then draw the page as per my recordset or required.
How do I do this in C# (within visual studio 2005)?
Please suggest common/best practice methodolgies and teminology.
Providing code examples would be great.
Thanks in advance.
Fabio