Click here to Skip to main content
15,929,811 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Problem In Using Wildcard Characters Pin
V.G9-Jul-07 21:29
V.G9-Jul-07 21:29 
QuestionChange Database Connection in Runtime-Need help Pin
pyrocoder9-Jul-07 20:54
pyrocoder9-Jul-07 20:54 
AnswerRe: Change Database Connection in Runtime-Need help Pin
_Damian S_9-Jul-07 21:04
professional_Damian S_9-Jul-07 21:04 
GeneralRe: Change Database Connection in Runtime-Need help Pin
pyrocoder9-Jul-07 21:09
pyrocoder9-Jul-07 21:09 
GeneralRe: Change Database Connection in Runtime-Need help Pin
Tom Deketelaere9-Jul-07 21:17
professionalTom Deketelaere9-Jul-07 21:17 
GeneralRe: Change Database Connection in Runtime-Need help Pin
pyrocoder9-Jul-07 21:26
pyrocoder9-Jul-07 21:26 
GeneralRe: Change Database Connection in Runtime-Need help Pin
Tom Deketelaere9-Jul-07 21:40
professionalTom Deketelaere9-Jul-07 21:40 
AnswerRe: Change Database Connection in Runtime-Need help Pin
Tom Deketelaere9-Jul-07 21:47
professionalTom Deketelaere9-Jul-07 21:47 
ok have a small example here's the code (bit much but since I can't attach it no choice)

<code>
Public Class Form1
Private con1 As String
Private con2 As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con1 = "Server=999.999.999.999;Database=master;user ID=master;Password=master;Trusted_Connection=false"
con2 = "Server=000.000.000.000;Database=master;user ID=master;Password=master;Trusted_Connection=false"
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
clsDA.msConnectie = con1
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
clsDA.msConnectie = con2
End Sub
End Class

Imports System.Data.SqlClient
Public Class clsDA
Public Shared msConnectie As String
Public Shared Function GetDR(ByVal sSQL As String, ByVal ParamArray dbParams() As SqlParameter) As SqlDataReader
Dim oCommand As SqlCommand
Dim oDataReader As SqlDataReader
Dim ocon As SqlConnection
Try
ocon = New SqlConnection(msConnectie)
ocon.Open()
oCommand = ocon.CreateCommand
oCommand.CommandType = CommandType.Text
oCommand.CommandText = sSQL
For Each opar As SqlParameter In dbParams
oCommand.Parameters.Add(opar)
Next
oDataReader = oCommand.ExecuteReader(CommandBehavior.CloseConnection)
Catch ex As SqlException
...
End Try
Return oDataReader
End Function
End Class</code>

hope this helps
GeneralRe: Change Database Connection in Runtime-Need help Pin
pyrocoder9-Jul-07 21:54
pyrocoder9-Jul-07 21:54 
QuestionApplication Path Pin
Nanda16059-Jul-07 20:33
Nanda16059-Jul-07 20:33 
AnswerRe: Application Path Pin
_Damian S_9-Jul-07 21:09
professional_Damian S_9-Jul-07 21:09 
AnswerRe: Application Path Pin
Tom Deketelaere9-Jul-07 21:14
professionalTom Deketelaere9-Jul-07 21:14 
GeneralRe: Application Path Pin
Nanda16059-Jul-07 21:17
Nanda16059-Jul-07 21:17 
AnswerRe: Application Path Pin
Tom Deketelaere9-Jul-07 22:11
professionalTom Deketelaere9-Jul-07 22:11 
Questionserial to lan Pin
zamzoum9-Jul-07 20:07
zamzoum9-Jul-07 20:07 
AnswerRe: serial to lan Pin
Dave Kreskowiak10-Jul-07 3:21
mveDave Kreskowiak10-Jul-07 3:21 
Questionhow can i send mail over LAN using outlookexp Pin
koolprasad20039-Jul-07 19:40
professionalkoolprasad20039-Jul-07 19:40 
AnswerRe: how can i send mail over LAN using outlookexp Pin
Dave Kreskowiak10-Jul-07 3:19
mveDave Kreskowiak10-Jul-07 3:19 
GeneralRe: how can i send mail over LAN using outlookexp Pin
koolprasad200310-Jul-07 20:04
professionalkoolprasad200310-Jul-07 20:04 
GeneralRe: how can i send mail over LAN using outlookexp Pin
Dave Kreskowiak11-Jul-07 14:23
mveDave Kreskowiak11-Jul-07 14:23 
AnswerRe: how can i send mail over LAN using outlookexp Pin
Vasudevan Deepak Kumar10-Jul-07 4:34
Vasudevan Deepak Kumar10-Jul-07 4:34 
GeneralRe: how can i send mail over LAN using outlookexp Pin
koolprasad200310-Jul-07 20:05
professionalkoolprasad200310-Jul-07 20:05 
QuestionIPictureDisp to image control (ms access) Pin
Asif Rehman9-Jul-07 19:31
Asif Rehman9-Jul-07 19:31 
AnswerRe: IPictureDisp to image control (ms access) Pin
_Damian S_9-Jul-07 21:05
professional_Damian S_9-Jul-07 21:05 
GeneralRe: IPictureDisp to image control (ms access) Pin
Asif Rehman10-Jul-07 0:34
Asif Rehman10-Jul-07 0:34 

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.