473,407 Members | 2,306 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,407 software developers and data experts.

about connection string

I am developing a software using vb.net and SQL server as database .
it takes the name of my system in connection string and when i try to load my software in other computers it search the same name.how can i define a connection string that takes the name of system on which software is loaded?
Mar 14 '10 #1
1 930
kadghar
1,295 Expert 1GB
I'll asume you also moving the SQL base to the other computer, and you're using windows autentication, you can use ENVIRON("USERNAME") to retrieve the user name, something like this will do:

Conexion1.ConnectionString = "Server=" & Environ("username") & "\MyServer;Database=MyDB;Trusted_Connection=Tr ue;"
Mar 15 '10 #2

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

Similar topics

2
by: Ellen Manning | last post by:
Using A2K and adp. Is it necessary to open a connection (to SQL Server 2000) everytime you call a stored procedure or open a recordset? Or will opening a connection one time do, like at...
17
by: Bob Lehmann | last post by:
Hi, My understanding is that Dispose() should not be used for destroying a connection object, and that Close() is preferred. However, in one of MS's Quickstart Apps I see this being used.... ...
6
by: Joe | last post by:
Hi, I have a MS Access DB in which a record has just too many fields to be able to allow users to do inline editing in a datagrid. So I want to display as First Name: Text box where first...
7
by: Lau Lei Cheong | last post by:
Hello, Actually I think I should have had asked it long before, but somehow I haven't. Here's the scenerio: Say we have a few pages in an ASP.NET project, each of them needs to connect to...
7
by: Lars Netzel | last post by:
Hi How do I get information (read) about the phonenumber in the default Dial Up Connection? Best Regards/ Lars Netzel
0
by: jmzl666 | last post by:
Hi all, i hope i can explain mysel, english is no my first language. Well, i have a base class (a wrapper to work with oledb) with some properties and methods, and i have a inherited class (wrapper...
5
by: nick048 | last post by:
Hi to All, Foollowing Your suggestion, I have written this code: #include <stdio.h> #include <string.h> #include <malloc.h> #define BUFLEN 100
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.