C# .NET - want to develop window based application

Asked By Pinakin Patel on 16-Apr-10 07:44 AM
i want to develop small window based application for asset management.

but i don't want to use sql server because installation need sql server file which i don't want because in user computer its not necessary installed sql server on their machine.

i want to use database which does not require installation in client machine also can run on .net environment ( is it possible in sql server 2005).

so what should i do to overcome this problem.

give me solution as soon as possible. thanks you.

Pinakin Patel
+91 99744000333
Anoop S replied to Pinakin Patel on 16-Apr-10 07:59 AM
You can use Ms Access as a databse, the key advantages that Microsoft Access has is the ability to build a software system to manage a range of services very quickly, but it also have my drawback like security, meant to have multiple users at any given time,  but for desktop application Ms Access is the best database, you can add database while creareing setup package, so no need to install it saparetely

Anand Malli replied to Pinakin Patel on 16-Apr-10 08:00 AM

Hi Pinakin

user Sqlite its superb light weight and easily understandble,i used it in one of my project
there is also access is there but i would suggest you to go with sqlite


Goniey N (Mr. G) replied to Pinakin Patel on 16-Apr-10 08:04 AM
You Can Use OLEDB(Ms Access) As Your Database For That Follow This :

Imports System.Data.oledb    //Import This "oledb" Class

Dim conn As New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = /DATABASE.MDB") //For Create Connection With MS Access File, Here "DATABASE.MDB" Is MS Access File.

//Below Code Is For Retrieve Data From Database Into The Textbox.

            Dim cmd As New OleDbCommand
            Dim dr As OleDbDataReader
            cmd.Connection = conn
            cmd.CommandText = "Select UserName From User_Detail Where UserID like '" + txtUser.Text + "'"
   //Write Query For Get The Username From The database. Here "txtUser" Is TextBox Which Store The "UserId".
            dr = cmd.ExecuteReader()
            While dr.Read()
                txtUserName.Text = dr.GetValue(0).ToString 
//Store Data Into "txtUserName" Textbox.
            End While
        Catch ex As Exception
        End Try

//Using This You Can Connect Your Database With The The Controls.//

//I Hope This Will Very Helpful To You & It's Work 100%...
Pinakin Patel replied to Goniey N (Mr. G) on 16-Apr-10 08:10 AM

but i don't want to use access because it not necessary client does have ms office in their peronal computer......
Super Man replied to Pinakin Patel on 16-Apr-10 08:11 AM

hello pinakin, if there is small application and if only a some transaction ,

then you can use file in your application.

just do necessary operation.

and if you want flexible operation, than the file, then you can use ms-access

Pinakin Patel replied to Anand Malli on 16-Apr-10 08:14 AM
hi anand

but will you provide me information how to use sql in visual studio 2008? and how to create a database in sql lite. because i am totally new one...

Pinakin Patel replied to Anoop S on 16-Apr-10 08:33 AM

but i don't want to use access because it not necessary client does have ms office in their peronal computer....
Goniey N (Mr. G) replied to Pinakin Patel on 16-Apr-10 08:56 AM
Dear Pinakin,

Why Don't You Understand?

If there will be not ms office in client machine, still you can access your data from the file.
For Accessing data From The File you don't need to ms office.

//i hope now you clear & Using Access You Don't Need To Install Another Application Like SQL Server or Etc..
Anand Malli replied to Pinakin Patel on 16-Apr-10 09:30 AM
Hi Pinakin

you have to download lightweight free sqlite from following url


and than you can use it has any other database,i am providing you some links where you can find some sample to start with


Feel free to ask anything

Kirtan Patel replied to Pinakin Patel on 16-Apr-10 03:13 PM
As looking per your requirement you need to use SqLite database as it does not need any kind of installation / Driver to be install for the using it ..

its portable ..for example firefox browser uses SQLite database to store the user Settings :)
Mohan Raj Aryal replied to Pinakin Patel on 17-Apr-10 09:21 AM
Well, choosing about database is purely depend up on your size of the application and architecture of the application. 

Size of the application
Medium or Large Scale Data
I suppose your application will not have very large scale data. If your application will have medium or large scale data, then I recommend to use SQL Server. If your concern is about licensing cost you can use SQL Express. Visit this http://www.microsoft.com/downloads/details.aspx?familyid=220549b5-0b07-4448-8848-dcc397514b41&displaylang=enfor more details and downloading it. 

To develop your application in .net to use SQL Server database you can use System.Data.SqlClient library.

Small Data
MS Access is also fine to use if your application is having small scale database. You can use MS Access as a database in .NET using System.Data.Oledb. You can create a DSN pointing your MS Access file and connect to it. 
Another option is to use file as database probably XML is the best for this. But this is okay if your application has very few data manipulation.

Architecture of the application:
If your application is standalone application, you don't have option not to save database on the client machine. Because there would be only one machine where your application would be installed. Whatever database you use you will save the data on local machine

Client Server
If you have many clients and one database, you need to make a database server. And from the client application, you will connect to the database for data manipulation. In this case I would suggest you to use SQL Server.

You can connect to the server using connection string. Connection string contains the details of the database such as database server address, credentials to connect etc.

I hope this helps to you. If not please revert back.
Pinakin Patel replied to Mohan Raj Aryal on 17-Apr-10 01:56 PM
see my application is like inventory management system... so there are no more then 15 table in the application so please give me idea whether i use sql server express edition or its good if i use sqlite....

Mohan Raj Aryal replied to Pinakin Patel on 17-Apr-10 03:36 PM
I  would personally suggest to go for SQL Express. Because your application might end up being multi user. One of the biggest drawback of SQLite is, it was designed for Single User. Also there are other implementation limitations details are listed about SQLite: http://www.sqlite.org/limits.html. 

Yes, there is a limitation of SQL Express about 1GB maximum RAM and 4GB maximum database size.

It is up to you to decide but I would also suggest to have a look on Tread off between http://www.openlinksw.com/dataspace/kidehen@openlinksw.com/weblog/kidehen@openlinksw.com's%20BLOG%20[127]/968