Hi Guys,
I am trying to catch the %userid% as a variable so i can use it in my connectors sql querry string to filter for results based on the user logged in.
Im stuck as to how i can capture this information, any help would be apreciated.
the below code works and returns a result list from the sql querry i now need to filter this based on the %userid% of the user thats logged in.
Dim connection as New SqlConnection("user id=admin;password=;Data Source=VM-MAROUNM-WS;Initial Catalog=aps_dsql")
connection.Open()
Dim command As SqlCommand = connection.CreateCommand()
command.CommandText = "select objinstid,cltsortname,clttype,cltcode from cdbclient where cltsortname like '%ad%' and cltcode is not null"
Dim reader As SqlDataReader = command.ExecuteReader()
Dim str As StringBuilder = New StringBuilder("")
str.AppendFormat("
{0}", Header()) While (reader.Read()) str.AppendFormat(" | {0} | {1} | {2} | {3} |
", _ HttpUtility.HtmlEncode(reader("objinstid")), _ HttpUtility.HtmlEncode(reader("cltsortname")), _ HttpUtility.HtmlEncode(reader("clttype")), _ HttpUtility.HtmlEncode(reader("cltcode"))) End While connection.Close() reader.Close() str.Append("
")
Return str.ToString
End Function