how i can get connection string of db on host computer??

Pregunta how i can get connection string of db on host computer??

  • martes, 14 de febrero de 2006 17:27
     
     
    as my code is dependent on the database so whenever i take my code on the different computer, i need to set connection string for it and recompile the project.. can i get this string by using any api.. at run time ? i don't want to give it string every time when i change pc or database server..

Todas las respuestas

  • martes, 14 de febrero de 2006 18:06
     
     
    You can store it in the .config file
  • martes, 14 de febrero de 2006 18:10
     
     
    if i have it.. then why should i store it any where... the problem is that i don't know when i change my computer...
  • martes, 14 de febrero de 2006 19:44
    Moderador
     
     

    If the database resides on the same computer then nothing should change; unless you change the name of the database, of course (you are always on the local server). If it's a remote database then you should program in a way for the user to select the database.

    The simplest way, as stated, is to store it in a config file. You have to store it somewhere. It may be we are confused b what you are asking: try giving a simple example scenario.