473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Connection To Sql2005

mafaisal
142 100+
Hello Experts

I am Using Vb.Net 2005 And Sqlserver 2005

My Doubt is

Have we To Make Connection to Sql Like MsAcces..?
ie When we install setup file in client system is any soln to restore sql backup
file
When we install setup file using vb.net install only engine of sql
here we cannot find hw to restore bckup file
Nw we Followed way is also install sqlExpressAdvanced so we can get sqlservermanagement studio using that we can restore
But this is complicated, install setup, sqlExpress

My Question is Is any soln To avoid this When we run setup automatically Restore sql or manually without installing Another tools
or Any way to Connect sql like acces
ie we can to connect by providing path of mdf file or back up file of Sql

Please Give me Reply

Faisal
Mar 23 '08 #1
2 830
Hello,

There are a couple of ways to do this, and I'm not quite sure what you're asking, but here are two options:

The easiest way would be to copy the .mdf file along with whatever application you are distributing and then use a connection string that attaches the .mdf file... Something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. SqlConnection Con = new SqlConnection("Data Source=.\SQLEXPRESS;AttacheDBFilename=C:\\Path\\To\\Database.mdf;")
  2.  
Of course, you're probably going to need more parameters in your connection string, but that works fine as long as you're willing to have you're database reattached each time your app is started...

The other way would be to script your entire database to a massive query, and run that the first time your application runs. Then, you would probably have to use SqlBulkCopy or so to transfer all your data from your original database server onto the new installations...

Hope that helps,

- Loren VS
Mar 24 '08 #2
mafaisal
142 100+
Hello

Thanks Lorren For ur Reply

I also Get this from

Connectionstring

Thanks alot

Faisal

Hello,

There are a couple of ways to do this, and I'm not quite sure what you're asking, but here are two options:

The easiest way would be to copy the .mdf file along with whatever application you are distributing and then use a connection string that attaches the .mdf file... Something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. SqlConnection Con = new SqlConnection("Data Source=.\SQLEXPRESS;AttacheDBFilename=C:\\Path\\To\\Database.mdf;")
  2.  
Of course, you're probably going to need more parameters in your connection string, but that works fine as long as you're willing to have you're database reattached each time your app is started...

The other way would be to script your entire database to a massive query, and run that the first time your application runs. Then, you would probably have to use SqlBulkCopy or so to transfer all your data from your original database server onto the new installations...

Hope that helps,

- Loren VS
Mar 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: tony dong | last post by:
Hi there I use vs.net 2005 with standard sql 2005 under machine\sql2005 for instant when I create webpart, the code get from quickstart as follow: <%@ Page Language="C#" %> <%@ Register...
7
by: Steven Blair | last post by:
I have a DB connection performance issue in my C# app. I have used the Stopwatch to track how long it takes to do a couple things. Creating a SqlConnection object takes 19ms, and Opening a...
10
by: Steven Blair | last post by:
As I understand it, if I create a connection object in my application and close the connection, the next time I open a connection with the same connection string I should be using a pooled...
0
by: Hongbo | last post by:
Hi, I have a test server with Windows 2003 Standard Server. SQL Server 2000 Standard Edition was installed earlier as default instance. My ASP.Net web site works fine with the connection...
5
by: Mike | last post by:
I'm having trouble accessing SQL2005 Standard Edition as a second instance of SQL Server where the first instance is SQL 2000 Enterprise Edition. I installed SQL 2005 as a named instance...
1
by: Marvinq | last post by:
I'm a newbie to asp.net, but I have been a programmer for years. I have a question that I'm hoping someone can give me a good answer for, I have been trying to set up a site remotely and I've...
1
by: =?Utf-8?B?TWVuYWth?= | last post by:
i have developed a web application for intranet and it is installed on the Computer name 'Server' and its already installed sql server 2005, never problem when connecting to sql server 2005 on the...
1
by: Aykut Canturk | last post by:
Can I use SqlExpress2005 AttachDatabase feature with classic ADO connections in my .asp pages ? But I need ConnectionString. Although I searched the web for couple of weeks I still coulnd't find...
1
by: Dean Slindee | last post by:
VS2008, .NetFramework 3.5 SP1: I have built a LINQ data access layer project. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was...
0
by: nic829 | last post by:
Hi, I was upgrading a instance from SQL2000 to SQL2005. During SQL2005 setup I accidently allow the files to be installed in C drive, but I should have them all installed in D drive. My databases...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.