Click here to Skip to main content
13,196,946 members (52,240 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
i need your help .i made a desktop application i used sql server 2008 r2 for my database
in connection string used sql user name pass etc
if i made exe file of that app and run on another system ho can get pc name ,sql user name and pass of that system automatically

;User id=sa; +
;Password=golden3952; +
;MultipleActiveResultSets=True;
Posted 11-Jun-14 7:23am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

This is very simple string manipluation.

This is easily done with String.Format()...
    string template = "Data Source={0};Initial Catalog={1};User ID={2};Password={3};"
 
    string connectionString = string.Format(template, serverName, databaseName, userId, password);
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web03 | 2.8.171019.1 | Last Updated 11 Jun 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100