Click here to Skip to main content
15,905,679 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralMS Office document preview in windows form. Pin
satano66613-Apr-05 20:39
satano66613-Apr-05 20:39 
Questionhow to do this in windows service Pin
MagicGirL8313-Apr-05 14:52
MagicGirL8313-Apr-05 14:52 
Generalmailing + smtp Pin
_tasleem13-Apr-05 12:43
_tasleem13-Apr-05 12:43 
GeneralVB.NET Display Month in Text Not Number Format Pin
Anonymous13-Apr-05 11:24
Anonymous13-Apr-05 11:24 
GeneralRe: VB.NET Display Month in Text Not Number Format Pin
dpagka14-Apr-05 5:20
dpagka14-Apr-05 5:20 
GeneralWindows.Forms.DataGrid and NumericUpDown and/or DateTimePicker controls Pin
dprima13-Apr-05 10:31
dprima13-Apr-05 10:31 
QuestionWhat's the best way to do? Pin
Lisana13-Apr-05 9:42
Lisana13-Apr-05 9:42 
AnswerRe: What's the best way to do? Pin
Dave Kreskowiak14-Apr-05 5:21
mveDave Kreskowiak14-Apr-05 5:21 
When your application starts, it should check to see if there are values in the appropriate storage locations for your Inital Catalog and Data Source. These could be in the Registry or in a config file somewhere. If the values are not there, then your app should ask for them.

Once you have them, either input by the user or fetched out of the saved config, you can try and connect to the database and run a small query. If any part of the query process fails, then you can be pretty sure something is wrong and the code should return any errors to the user and either ask for corrected, or alternate, connection information or quit.

In my work, I like to setup a stored procedure in the database that returns a value specific to that database. For example, returning a string that specifies what the database name is, it's code version and its schema revision, like "TSEC ver:2.00 schema:6.30". This way, my code knows that this database is the correct one it should be working with, regardless of what the Data Source name is(!) and it gets additional information that the application might need. Such as taking into account dealing with an older version of a database's procedures or dealing with a minimum database version that's supported by the code.

Currently, Microsoft recommends NOT using the registry to store application configuration values, such as a connection string, but instead, recommends using .config files. Rocky Lhotka wrote a very good article for MSDN, found here[^], that explains configuration files and how to read and write them.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralVb 6.0 Pin
Bahadir Cambel13-Apr-05 7:39
Bahadir Cambel13-Apr-05 7:39 
GeneralRe: Vb 6.0 Pin
Dave Kreskowiak13-Apr-05 8:24
mveDave Kreskowiak13-Apr-05 8:24 
GeneralRe: Vb 6.0 Pin
Bahadir Cambel13-Apr-05 11:31
Bahadir Cambel13-Apr-05 11:31 
GeneralRe: Vb 6.0 Pin
Bahadir Cambel13-Apr-05 11:57
Bahadir Cambel13-Apr-05 11:57 
GeneralRe: Vb 6.0 Pin
rwestgraham13-Apr-05 12:58
rwestgraham13-Apr-05 12:58 
GeneralRe: Vb 6.0 Pin
Bahadir Cambel13-Apr-05 14:15
Bahadir Cambel13-Apr-05 14:15 
GeneralRe: Vb 6.0 Pin
Christian Graus13-Apr-05 15:12
protectorChristian Graus13-Apr-05 15:12 
GeneralRe: Vb 6.0 Pin
rwestgraham13-Apr-05 19:15
rwestgraham13-Apr-05 19:15 
GeneralRe: Vb 6.0 Pin
Christian Graus13-Apr-05 19:28
protectorChristian Graus13-Apr-05 19:28 
GeneralRe: Vb 6.0 Pin
rwestgraham13-Apr-05 21:05
rwestgraham13-Apr-05 21:05 
GeneralRe: Vb 6.0 Pin
Christian Graus14-Apr-05 0:10
protectorChristian Graus14-Apr-05 0:10 
GeneralRe: Vb 6.0 Pin
Dave Kreskowiak14-Apr-05 3:34
mveDave Kreskowiak14-Apr-05 3:34 
GeneralRe: Vb 6.0 Pin
Giancarlo Aguilera14-Apr-05 7:01
Giancarlo Aguilera14-Apr-05 7:01 
GeneralRe: Vb 6.0 Pin
Christian Graus14-Apr-05 12:17
protectorChristian Graus14-Apr-05 12:17 
GeneralRe: Vb 6.0 Pin
rwestgraham14-Apr-05 10:55
rwestgraham14-Apr-05 10:55 
GeneralRe: Vb 6.0 Pin
Christian Graus14-Apr-05 12:23
protectorChristian Graus14-Apr-05 12:23 
GeneralRe: Vb 6.0 Pin
rwestgraham14-Apr-05 13:41
rwestgraham14-Apr-05 13:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.