Click here to Skip to main content
15,905,971 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use Microsoft SQL Server 2005 in my Visual Studio 2008 Express Edition,my one application is to update the database, and the other is to view the contents of the database with its data. The update application works, when i go to my other application and view the contents of the database my database is empty. Why?
Posted
Updated 28-Apr-14 17:40pm
Comments
Laiju k 28-Apr-14 23:41pm    
have you googled
Sergey Alexandrovich Kryukov 29-Apr-14 0:09am    
Google for what? "How did I screw up things?"?
—SA
charosales 28-Apr-14 23:42pm    
yes,I already have but no answers at all
DamithSL 29-Apr-14 0:04am    
what is your connection string ?
RahulMGunjal 29-Apr-14 0:15am    
Are you using same connection string in both the applications?

1 solution

I just use the dataset of the the database.

In your second application/project do these steps:
1. right click the project
2. add existing item
3. select the database dataset, the extension should be '.xsd'

There you go, you can now view the data of the database using Datagrid or Crystal report.

***Note****
In your connection string follow these steps:
1. right click project
2. select properties
3. select settings

from there just add the name of your connection,
Type: string
Scope: Application
Value: Data Source=.\SQLEXPRESS;AttachDbFilename="the path of the database";Integrated Security=True;Connect Timeout=30;User Instance=True

example:
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Users\user\Documents\Visual Studio 2008\Projects\Massaji\Massaji\MassajiDatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900