How to set up a database and use it
-
Hi, I've been stuck for some time trying to set up a database and access it from a program. I don't know which database to use which is part of my problem. I've tried using sql server but I don't know how to create a connection to it from a program. For example I have a connection string but I don't know what to use as a user id or password. I had an oleDb database set up and it was working fine but I don't know how to write data to it. Could somebody give me advice on which database to use and how to set it up? Any help would be appreciated. Thanks oh by the way I'm using c#
-
Hi, I've been stuck for some time trying to set up a database and access it from a program. I don't know which database to use which is part of my problem. I've tried using sql server but I don't know how to create a connection to it from a program. For example I have a connection string but I don't know what to use as a user id or password. I had an oleDb database set up and it was working fine but I don't know how to write data to it. Could somebody give me advice on which database to use and how to set it up? Any help would be appreciated. Thanks oh by the way I'm using c#
I would advise you to get a few good books, but to your questions:
toprogramminguy wrote:
I don't know which database to use which is part of my problem
You could use SQL Server Express Edition. Download, install it and start using by creating a db, tables etc.
toprogramminguy wrote:
I've tried using sql server but I don't know how to create a connection to it from a program
You use SqlConnection[^]. Define a connection string and open the connection. Good example in the link in examples.
toprogramminguy wrote:
I don't know what to use as a user id or password
If you use integrated security, you don't need separate username and password. If you use SQL Server authentication, you use SA as user and the password is defined during setup.
toprogramminguy wrote:
I had an oleDb database set up and it was working fine but I don't know how to write data to it
Don't know what this means. OleDb is a way to connect to a database, not a database. One book you could start with is: Beginning C# 2008 Databases: From Novice to Professional [^]
The need to optimize rises from a bad design.My articles[^]
-
I would advise you to get a few good books, but to your questions:
toprogramminguy wrote:
I don't know which database to use which is part of my problem
You could use SQL Server Express Edition. Download, install it and start using by creating a db, tables etc.
toprogramminguy wrote:
I've tried using sql server but I don't know how to create a connection to it from a program
You use SqlConnection[^]. Define a connection string and open the connection. Good example in the link in examples.
toprogramminguy wrote:
I don't know what to use as a user id or password
If you use integrated security, you don't need separate username and password. If you use SQL Server authentication, you use SA as user and the password is defined during setup.
toprogramminguy wrote:
I had an oleDb database set up and it was working fine but I don't know how to write data to it
Don't know what this means. OleDb is a way to connect to a database, not a database. One book you could start with is: Beginning C# 2008 Databases: From Novice to Professional [^]
The need to optimize rises from a bad design.My articles[^]
I mean an mdb database. I thought that was an ole db database. Thanks anyway :-)
-
I mean an mdb database. I thought that was an ole db database. Thanks anyway :-)
toprogramminguy wrote:
I mean an mdb database
Okay, I see. Mdb is a SQL Server database file which can be attached to an existing SQL Server instance and then it can be used.
toprogramminguy wrote:
Thanks anyway
You're welcome :)
The need to optimize rises from a bad design.My articles[^]