In a function where I'm gathering claim data per policy, I execute a stored procedure and the result set returned with the following code:
scGet_Claim_Data = New SqlCommand("Get_Claim_Data", scDBConnection)
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@PolNum", SqlDbType.VarChar, 18)
.Parameters("@PolNum").Value = sdrBasicPolicyInfo.Item("PolNum")
.Parameters.Add("@userdate", SqlDbType.DateTime, 18)
.Parameters("@userdate").Value = dteuserdate
sdrLossRecordInfo = .ExecuteReader()
I have created structures that will assemble the data returned and write it to a text file.
There is one trigger for a particular field that will require another query to be run against the same database to gather additional information.
IF a claim meets this requirement, I want to pass, Policy Number and Claim Number to another function and a procedure that would be connecting to the same database. Could I re-use the connection since it would still be open in the other function? Or would I simply need to create another connection using the same connection string?
For example, the connection string used above is scDBConnection, would I just need to create scDBConnection2? Can I even do that since there is a live connection against the database?
Trying to plan on how to accomplish this...Thanks!