I have 4 table
District(districtid(P),Districtname)
Tehsil(Tehsilid(P),Tehsilname,DistrictID(F))
UC(UCid(P),UCname,TehsilID(F))
Village(Villageid(P),Villagename,UCID(F))
F Stand for Foreign key and P for Primary key
I am using table value parameter for bulk insert but on each row I have to call a method to get the ID for example if i take an exmaple of saving the 200 villages the The village id comes from check box for for its UC I have to call a method in vb.net code and then this method get out the UC id of that village so it makes my process slow any solution????
Get primay key value
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Shakti Singh DulawatRank #668 · 3.6K reputationPosted Apr 15, 2015, 6:38 AM EDT
Danish HabibRank #2,024 · 715 reputationPosted Apr 15, 2015, 8:35 AM EDT
Like (districtid(P),DistrictName)
2nd table((P)UCID,UCNAme,DistrictID(F))
P for PRimary key and F for foreign key
Dim Ucid As Integer = GetTehsilIDIds(CheckBoxList3.Items(i3).Value)
i am using that line in code so if 200 rows i have then 200 times that method called so it makes my insertion process slow