অবসরের আড্ডা!!!
Using global variables in Vb.net windows app
That's what I was thinking, the code below is how its currently structured.
'Declare Parameter
Dim prmSearch_U As New SqlClient.SqlParameter
'Declare Command
CmdDgrSearch_U = New SqlCommand
CmdDgrSearch_U.Connection = CnClaim
CmdDgrSearch_U.CommandType = CommandType.StoredProcedure
CmdDgrSearch_U.CommandText = "SrcU_Insured"
'Declare DataAdapter
DaDgrSearch_U = New SqlDataAdapter
DaDgrSearch_U.SelectCommand = CmdDgrSearch_U
If CslGlobal.mSearchOpt = 1 Then
With prmSearch_U
.ParameterName = "@Insured"
.SqlDbType = SqlDbType.Text
.Size = 200
.Direction = ParameterDirection.Input
.Value = CslGlobal.mCritSearch
End With
With DaDgrSearch_U
.SelectCommand = CmdDgrSearch_U
.SelectCommand.Parameters.Add(prmSearch_U)
End With
End If
'Declare Data Set
DsDgrSearch_U = New DataSet
Then my global variable class is;
Public Class CslGlobal
'Criteria Search on Search Form
Public Shared mCritSearch As String
'Search Option on Search Form
Public Shared mSearchOpt As Integer
End Class
I'm a little unclear on precisely how to accomplish what you are suggesting to do in creating a User Parameter Class. It would seem that in the case of 100 users, I would have to create 100 differenent Instances, which is fine. But, in the case of declaring the dataAdapter, which is shown below and above;
With prmSearch_U
.ParameterName = "@Insured"
.SqlDbType = SqlDbType.Text
.Size = 200
.Direction = ParameterDirection.Input
.Value = CslGlobal.mCritSearch '
অনলাইনে ছড়িয়ে ছিটিয়ে থাকা কথা গুলোকেই সহজে জানবার সুবিধার জন্য একত্রিত করে আমাদের কথা । এখানে সংগৃহিত কথা গুলোর সত্ব (copyright) সম্পূর্ণভাবে সোর্স সাইটের লেখকের এবং আমাদের কথাতে প্রতিটা কথাতেই সোর্স সাইটের রেফারেন্স লিংক উধৃত আছে ।