c# - Table valued parameters - time out -


I have applied table honorable parameters that are populated by the C # program and finally stored procedure for storing in tables Uses. I found that if I send 75 records at a time, then it takes time or I do not. How can I include more records at one time?

- Select the top 75 master reassures where .... Recs many details in each master recs

- The list of collections has been made and with these 75 rec, their extensive recieved and inserted copper has been added.

  Private static zero empty copper (List & lt; MasterTbl & gt; New MinuteBlock, List & Lt; ExpansionTebby & gt; New DredTubluble) {Init 32 Rows Affected = 0; Try {DataSet ds = new DataSet (); Datatale dtMasterVerified = Create DataTable (); Datatable dtMasterVerified1 = dtMasterVerified.Clone (); Datatyll dtDetail = CreateDatatableDetail (); Datatelle dtDetail1 = dtDetail.Clone (); Leading (AdverbitterTMM TMP in New Mintib) {Datarave Domaster = DTMasterVirified 1.NewRow (); Daumaster ["id"] = tmpiid; Daumaster ["address 1"] = tmp.address1; Daumaster ["address2"] = tmp.address2; Dromster ["city"] = tmp.city; Daumaster ["state"] = tmp.state; Daumaster ["zip"] = tmp.zip; Daumaster ["country"] = tmp.country; Daumaster ["status"] = tmp. Status; DrMaster ["errormsg"] = tmp.errormsg; Forex Currency (tmpDetail in Extended Newblack) {Datarave DDTPT = dtDetail1.NewRow (); DrDetail ["id"] = tmpDetail.ID; DrDetail ["name"] = tmpDetail.name; DrDetail ["updDate"] = tmpDetail.updDate; DtDetail1.ImportRow (drDetail); DtDetail1.Rows.Add (drDetail); } DtDetail1.ImportRow (drMaster); DtDetail1.Rows.Add (drMaster); } String Connection String = GetConnectionString (); (SqlConnection connection = New SqlConnection (connectionString)) is using {connection.Open (); SqlCommand CMD = New SqlCommand ("dbo.uspInsert_temp_AllRecs", connection); Cmd.CommandType = CommandType.StoredProcedure; CMD. Comma timeout = 2000; SqlParameter parameter = new SqlParameter (); Parameter. ParmeterName = "@MasterObj"; Parameter.SqlDbType = System.Data.SqlDbType.structured; Parameter.Value = dtMasterVerified1; Parameter. Type name = "db.master_verified"; Cmd.Parameters.Add (parameter); SqlParameter parameter2 = new SqlParameter (); Parameter 2.PameterNet = "@DTOTOBJ"; Parameter 2.SqlDbType = System.Data.SqlDbType.structured; Parameter2 Value = dtDetail1; Parameter2 Type = name = "db.Detail_verified"; Cmd.Parameters.Add (parameter2); {Try Rows = CMD.exquent (); } Hold (exception AP) {Console.WriteLine (ep.Message); }}} Hold (exception e) {Console.WriteLine (E. StackTrace); }} Making process [db] [UspInsert_temp_AllRecs] Select @MasterObj Master_Verified Readonly, @DetailObj Detail_verified only db.temp_Master_tbl as read (....) (db.temp_Detail_tbl in @MasterObj INSERT from SELECT * ....) * @ the DetailObj  

Thanks R

I just had this problem and I'm sure It may not be that we have the same problem due to the lack of information, but I will post it here and hope that it helps.

I was using a valuable parameter in my table in a host. When I took it in an existing statement, the time had come to an end. I believe that I have a better reason than how a query planner works, besides a verb.

Basic - Timeline for reasons:

  Select. * From Dbo T 1 t1.val = t2.val  
modify

- Works:

  select T. As to the selection of tap t t 1 is present (@table from d2.Table1 where t2.val = t1.val)  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -