P
Patriot
I have a stored procedure. If I run it using Query Analizer, it takes
no time to return the result (max 2 records, 7 columns and approx. 15
bytes/record)
However, If I execute it from ASPNET Code (see below), it takes approx.
1 - 2 seconds.
If I have to loop and list of Part_IDs (500-1000 records), this adds up
to significantly of wait time for a webbrowser. In fact, in Production,
it usually throws an error stating "Object Reference not set to an
instance of an object".
If I debug it in VS.2003, it will go through without issue though it
takes hella long time.
Has anyone experienced a similar problem with ADONET? or Can you help
me point out what is wrong with the code below?
Thank you in advance.
sqlAdt = New SqlDataAdapter("DB_LIST_PRICE_HISTORY_B2SP",
iDatabankConn)
sqlAdt.SelectCommand.CommandType = CommandType.StoredProcedure
sqlAdt.SelectCommand.Parameters.Add("@PART_ID_in", SqlDbType.VarChar,
25).Value = drDtl("Part_ID")
sqlAdt.SelectCommand.Parameters.Add("@PRICE_REGION_ID_in",
SqlDbType.Int).Value = iPriceRegionID.ToString
sqlAdt.SelectCommand.Parameters.Add("@FROM_DATE_in", SqlDbType.VarChar,
10).Value = ""
sqlAdt.SelectCommand.Parameters.Add("@TO_DATE_in", SqlDbType.VarChar,
10).Value = Convert.ToDateTime(Tdate).AddDays(1).ToShortDateString
lDs = New DataSet
sqlAdt.Fill(lDs, "PriceHist")
no time to return the result (max 2 records, 7 columns and approx. 15
bytes/record)
However, If I execute it from ASPNET Code (see below), it takes approx.
1 - 2 seconds.
If I have to loop and list of Part_IDs (500-1000 records), this adds up
to significantly of wait time for a webbrowser. In fact, in Production,
it usually throws an error stating "Object Reference not set to an
instance of an object".
If I debug it in VS.2003, it will go through without issue though it
takes hella long time.
Has anyone experienced a similar problem with ADONET? or Can you help
me point out what is wrong with the code below?
Thank you in advance.
sqlAdt = New SqlDataAdapter("DB_LIST_PRICE_HISTORY_B2SP",
iDatabankConn)
sqlAdt.SelectCommand.CommandType = CommandType.StoredProcedure
sqlAdt.SelectCommand.Parameters.Add("@PART_ID_in", SqlDbType.VarChar,
25).Value = drDtl("Part_ID")
sqlAdt.SelectCommand.Parameters.Add("@PRICE_REGION_ID_in",
SqlDbType.Int).Value = iPriceRegionID.ToString
sqlAdt.SelectCommand.Parameters.Add("@FROM_DATE_in", SqlDbType.VarChar,
10).Value = ""
sqlAdt.SelectCommand.Parameters.Add("@TO_DATE_in", SqlDbType.VarChar,
10).Value = Convert.ToDateTime(Tdate).AddDays(1).ToShortDateString
lDs = New DataSet
sqlAdt.Fill(lDs, "PriceHist")