StreamReader & error handling
CheckOff & ChangeBar changes CheckOff & Gen -> Base
This commit is contained in:
@@ -41,8 +41,10 @@ namespace DataLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader srf = new StreamReader(path);
|
||||
xd = new XmlDocument();
|
||||
xd.Load(path);
|
||||
xd.Load(srf);
|
||||
//xd.Load(path);
|
||||
fmtdata = xd.OuterXml;
|
||||
}
|
||||
catch(Exception ex)
|
||||
@@ -61,8 +63,10 @@ namespace DataLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader sr = new StreamReader(path);
|
||||
XmlDocument xdg = new XmlDocument();
|
||||
xdg.Load(path);
|
||||
xdg.Load(sr);
|
||||
//xdg.Load(path);
|
||||
genmacdata = xdg.OuterXml;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -89,7 +93,15 @@ namespace DataLoader
|
||||
}
|
||||
// use the format name if base or non sub. If it's a sub, remove the "_".
|
||||
string fname = issub ? format.Replace("_", "") : format;
|
||||
Format rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||
Format rec = null;
|
||||
try
|
||||
{
|
||||
rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
|
||||
}
|
||||
return rec;
|
||||
}
|
||||
public void LoadAllFormats()
|
||||
|
Reference in New Issue
Block a user