G
Guest
Hi!
I am trying to improve the speed of the app. Can you tell me if i need to
use AddWithKey or not? Thanks.
if (base.OpenDB() != System.Data.ConnectionState.Open) { throw new
Exception("Unable to open DB connection!"); }
string sSQL = "SELECT * FROM PROCESSCONTROLVIEW WHERE GROUP_ID = '" + sTemp
+ "'";
da = new SqlDataAdapter(sSQL, base.Connection);
ds = new System.Data.DataSet();
cb = new SqlCommandBuilder(da);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.Fill(ds, "PROCESSCONTROLVIEW");
if (ds.Tables["PROCESSCONTROLVIEW"].Rows.Count != 1)
return new VCDI();
try
{
cdi.Head.PressNum =
ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["PRESS_NUM"].ToString().ToCharArray();
}
catch (Exception)
{
cdi.Head.PressNum[0] = '\x30';
cdi.Head.PressNum[1] = '\0';
}
try
{
cdi.Head.LayNum =
ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["LAY_NUM"].ToString().ToCharArray();
}
catch (Exception)
{
cdi.Head.LayNum[0] = '\x30';
cdi.Head.LayNum[1] = '\0';
}
try
{
cdi.Head.ReadTime =
DateTime.Parse(ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["READDATE"].ToString());
}
catch (Exception)
{
cdi.Head.ReadTime = DateTime.Now;
}
try
{
cdi.Head.ReaderNumber =
ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["READER_NUM"].ToString().ToCharArray();
}
catch (Exception)
{
cdi.Head.ReaderNumber = "0".ToCharArray();
}
I am trying to improve the speed of the app. Can you tell me if i need to
use AddWithKey or not? Thanks.
if (base.OpenDB() != System.Data.ConnectionState.Open) { throw new
Exception("Unable to open DB connection!"); }
string sSQL = "SELECT * FROM PROCESSCONTROLVIEW WHERE GROUP_ID = '" + sTemp
+ "'";
da = new SqlDataAdapter(sSQL, base.Connection);
ds = new System.Data.DataSet();
cb = new SqlCommandBuilder(da);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.Fill(ds, "PROCESSCONTROLVIEW");
if (ds.Tables["PROCESSCONTROLVIEW"].Rows.Count != 1)
return new VCDI();
try
{
cdi.Head.PressNum =
ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["PRESS_NUM"].ToString().ToCharArray();
}
catch (Exception)
{
cdi.Head.PressNum[0] = '\x30';
cdi.Head.PressNum[1] = '\0';
}
try
{
cdi.Head.LayNum =
ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["LAY_NUM"].ToString().ToCharArray();
}
catch (Exception)
{
cdi.Head.LayNum[0] = '\x30';
cdi.Head.LayNum[1] = '\0';
}
try
{
cdi.Head.ReadTime =
DateTime.Parse(ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["READDATE"].ToString());
}
catch (Exception)
{
cdi.Head.ReadTime = DateTime.Now;
}
try
{
cdi.Head.ReaderNumber =
ds.Tables["PROCESSCONTROLVIEW"].Rows[0]["READER_NUM"].ToString().ToCharArray();
}
catch (Exception)
{
cdi.Head.ReaderNumber = "0".ToCharArray();
}