Click here to Skip to main content
15,924,039 members
Home / Discussions / C#
   

C#

 
GeneralRe: select from a datatable Pin
Nader Elshehabi27-Sep-06 4:59
Nader Elshehabi27-Sep-06 4:59 
GeneralRe: select from a datatable Pin
playout27-Sep-06 19:51
playout27-Sep-06 19:51 
GeneralRe: select from a datatable Pin
Not Active28-Sep-06 2:09
mentorNot Active28-Sep-06 2:09 
GeneralRe: select from a datatable Pin
playout27-Sep-06 19:56
playout27-Sep-06 19:56 
GeneralRe: select from a datatable Pin
Not Active28-Sep-06 2:11
mentorNot Active28-Sep-06 2:11 
QuestionAccess metod from thread Pin
Neuromancer_27-Sep-06 4:20
Neuromancer_27-Sep-06 4:20 
AnswerRe: Access metod from thread Pin
Nader Elshehabi27-Sep-06 4:34
Nader Elshehabi27-Sep-06 4:34 
QuestionHere's a free db connection object for all!! Any improvement ideas? Pin
Goalie3527-Sep-06 3:49
Goalie3527-Sep-06 3:49 
Ok, I created a sql server database connection object for all to use if you're interested however I'm posting this on here with the hopes that people try to make improvements upon it and can share their changes with me. I've only been coding in C# for a little while now so I'm hoping for some advice on where I can make improvements.

Currently, it's only compatible with SQL Server & requires a stored procedure and it then reads a connection string stored in either the web.config or app.config file.

It can return data as a datatable or dataset or return nothing at all. Each method can accept up to 10 arguments to be passed into a stored procedure. If a user needs to declare more than 10 arguments, they must pass them in as an array.

So for those who don't know, a sample web.config file would be setup like this (although I recomend encrypting your config file if you use this on a server):
------------------------------------------------------------------
<configuration>
<appSettings/>
<connectionStrings>
<add name="SqlServerConnection"
connectionString="Data Source = yourDataSource;Initial Catalog = dbName;User Id =yourUserId;Password = yourPWord;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
-------------------------------------------------------------------

You can then create an instance of the DBConn object like the following:
----------------------------------------------------------------------
DBConn dbConnection = new DBConn("SqlServerConnection");
DataTable dtTable = dbConnection.PopulateDataTable("storedProcName", argument1);
----------------------------------------------------------------------

The file can be located at http://www.jennyperl.com/stuff/DBConn.zip

I'd greatly appreciate any advice/additions that can be made to this to help improve upon it. If you simply wish to use it as is and make no improvements, I hope it helps make your coding a little easier.

If you wish to contact me personally, you can email me at goalie35_33@yahoo.com.

Thanks.

-Goalie35
AnswerRe: Here's a free db connection object for all!! Any improvement ideas? Pin
Colin Angus Mackay27-Sep-06 5:41
Colin Angus Mackay27-Sep-06 5:41 
AnswerRe: Here's a free db connection object for all!! Any improvement ideas? Pin
Michael P Butler27-Sep-06 6:33
Michael P Butler27-Sep-06 6:33 
QuestionProgrammatically grouping taskbar buttons Pin
Wjousts27-Sep-06 3:40
Wjousts27-Sep-06 3:40 
AnswerRe: Programmatically grouping taskbar buttons Pin
Ed.Poore27-Sep-06 4:19
Ed.Poore27-Sep-06 4:19 
GeneralRe: Programmatically grouping taskbar buttons Pin
Wjousts27-Sep-06 5:10
Wjousts27-Sep-06 5:10 
GeneralRe: Programmatically grouping taskbar buttons Pin
Ed.Poore27-Sep-06 5:20
Ed.Poore27-Sep-06 5:20 
GeneralRe: Programmatically grouping taskbar buttons Pin
Wjousts27-Sep-06 6:16
Wjousts27-Sep-06 6:16 
GeneralRe: Programmatically grouping taskbar buttons Pin
Ed.Poore27-Sep-06 8:19
Ed.Poore27-Sep-06 8:19 
GeneralRe: Programmatically grouping taskbar buttons Pin
Wjousts27-Sep-06 10:14
Wjousts27-Sep-06 10:14 
GeneralRe: Programmatically grouping taskbar buttons Pin
Ed.Poore27-Sep-06 11:40
Ed.Poore27-Sep-06 11:40 
Questionsearch button Pin
faladrim27-Sep-06 3:39
faladrim27-Sep-06 3:39 
AnswerRe: search button Pin
Wjousts27-Sep-06 3:44
Wjousts27-Sep-06 3:44 
GeneralRe: search button Pin
faladrim27-Sep-06 3:52
faladrim27-Sep-06 3:52 
GeneralRe: search button Pin
Eric Dahlvang27-Sep-06 4:12
Eric Dahlvang27-Sep-06 4:12 
GeneralRe: search button Pin
faladrim27-Sep-06 4:18
faladrim27-Sep-06 4:18 
GeneralRe: search button Pin
faladrim27-Sep-06 4:31
faladrim27-Sep-06 4:31 
GeneralRe: search button Pin
Eric Dahlvang27-Sep-06 9:19
Eric Dahlvang27-Sep-06 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.