Hi,
Currently I am developing ASP.Net 2.0 application using SQL Server 2005
I need to create a stored procedure that upadates 10 Tables with parameters around 500. I use Microsoft Data Application Block for DAL.
Database db = DatabaseFactory .CreateDatabase ("Con");
DbCommand cmd = db.GetStoredPro cCommand("spI_S iteDetails");
db.AddInParamet er(cmd,"@SiteId ",DbType.String ,Properties.Sit eId);
db.AddInParamet er(cmd,"@Client ",DbType.Int16, Properties.Clie nt);
db.AddInParamet er(cmd,"@Countr y",DbType.Int16 ,Properties.Cou ntry);
db.AddInParamet er(cmd,"@Circle ",DbType.Int16, Properties.Circ le);
db.AddInParamet er(cmd,"@Region ",DbType.String ,Properties.Reg ion);
db.AddInParamet er(cmd,"@SiteNa me",DbType.Stri ng,Properties.S iteName);
if (Properties.Sit eType == "0")
{
db.AddInParamet er(cmd, "@SiteType" , DbType.String, null);
}
else
{
db.AddInParamet er(cmd, "@SiteType" , DbType.Int16, Convert.ToInt16 (Properties.Sit eType));
}
db.AddInParamet er(cmd, "@SiteAddre ss", DbType.String, Properties.Site Address);
db.AddInParamet er(cmd,"@TowerH eight",DbType.I nt16,Properties .TowerHeight);
if (Properties.Equ ipType == "0")
{
db.AddInParamet er(cmd, "@EquipType ", DbType.String, null);
}
else
{
db.AddInParamet er(cmd, "@EquipType ", DbType.Int16, Convert.ToInt16 (Properties.Equ ipType));
}
db.AddInParamet er(cmd,"@Latitu de1",DbType.Int 16,Properties.L at1);
db.AddInParamet er(cmd,"@Latitu de2",DbType.Int 16,Properties.L at2);
db.AddInParamet er(cmd,"@Latitu de3",DbType.Dec imal,Properties .Lat3);
db.AddInParamet er(cmd,"@Longit ude1",DbType.In t16,Properties. Long1);
db.AddInParamet er(cmd,"@Longit ude2",DbType.In t16,Properties. Long2);
db.AddInParamet er(cmd,"@Longit ude3",DbType.De cimal,Propertie s.Long3);
db.AddInParamet er(cmd,"@IntimG ivenPln",DbType .DateTime,Prope rties.IntimPln) ;
......
db.ExecuteNonQu ery(cmd);
errormsg = db.GetParameter Value(cmd, "ErrorMsg").ToS tring();
Please help me to increase the perfomanace of this DAL.
Thanks,
Uma Ramiya
Currently I am developing ASP.Net 2.0 application using SQL Server 2005
I need to create a stored procedure that upadates 10 Tables with parameters around 500. I use Microsoft Data Application Block for DAL.
Database db = DatabaseFactory .CreateDatabase ("Con");
DbCommand cmd = db.GetStoredPro cCommand("spI_S iteDetails");
db.AddInParamet er(cmd,"@SiteId ",DbType.String ,Properties.Sit eId);
db.AddInParamet er(cmd,"@Client ",DbType.Int16, Properties.Clie nt);
db.AddInParamet er(cmd,"@Countr y",DbType.Int16 ,Properties.Cou ntry);
db.AddInParamet er(cmd,"@Circle ",DbType.Int16, Properties.Circ le);
db.AddInParamet er(cmd,"@Region ",DbType.String ,Properties.Reg ion);
db.AddInParamet er(cmd,"@SiteNa me",DbType.Stri ng,Properties.S iteName);
if (Properties.Sit eType == "0")
{
db.AddInParamet er(cmd, "@SiteType" , DbType.String, null);
}
else
{
db.AddInParamet er(cmd, "@SiteType" , DbType.Int16, Convert.ToInt16 (Properties.Sit eType));
}
db.AddInParamet er(cmd, "@SiteAddre ss", DbType.String, Properties.Site Address);
db.AddInParamet er(cmd,"@TowerH eight",DbType.I nt16,Properties .TowerHeight);
if (Properties.Equ ipType == "0")
{
db.AddInParamet er(cmd, "@EquipType ", DbType.String, null);
}
else
{
db.AddInParamet er(cmd, "@EquipType ", DbType.Int16, Convert.ToInt16 (Properties.Equ ipType));
}
db.AddInParamet er(cmd,"@Latitu de1",DbType.Int 16,Properties.L at1);
db.AddInParamet er(cmd,"@Latitu de2",DbType.Int 16,Properties.L at2);
db.AddInParamet er(cmd,"@Latitu de3",DbType.Dec imal,Properties .Lat3);
db.AddInParamet er(cmd,"@Longit ude1",DbType.In t16,Properties. Long1);
db.AddInParamet er(cmd,"@Longit ude2",DbType.In t16,Properties. Long2);
db.AddInParamet er(cmd,"@Longit ude3",DbType.De cimal,Propertie s.Long3);
db.AddInParamet er(cmd,"@IntimG ivenPln",DbType .DateTime,Prope rties.IntimPln) ;
......
db.ExecuteNonQu ery(cmd);
errormsg = db.GetParameter Value(cmd, "ErrorMsg").ToS tring();
Please help me to increase the perfomanace of this DAL.
Thanks,
Uma Ramiya