N
Neel
HiAll,
I converted the below 2 sets of code into VB.net,with
conversion tools. I am getting a syntax error.
Can some one help me to convert the below code into
VB.net ?
I am building on the fly xml for xmlhttp to fill up the
drop downs. i have tested this in C# it is working fine.
------------------Set 1-----------------------------
strSQL = "Select Title from [Titles] Where ISBN = '" + Id
+ "'";
da = new OleDbDataAdapter(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"TitleName");
dt = ds.Tables[0];
StringBuilder sbTitle = new StringBuilder("");
if(dt.Rows.Count > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbTitle.Append("<TITLE VALUE=");
sbTitle.Append("\"" + dr["Title"].ToString() + "\"");
sbTitle.Append("/>");
}
StringBuilder sb = new StringBuilder("");
sb.Append("<?xml version=\"1.0\"?>");
sb.Append("<ROOT>");
sb.Append(sbTitle.ToString());
sb.Append("</ROOT>");
Response.Write(sb.ToString());
========================================================
-----------Set 2 ---------------------------------------
strSQL = "Select ISBN,Au_id from [Title Author] Where
Au_Id = " + Id;
da = new OleDbDataAdapter(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"ISBNList");
dt = ds.Tables[0];
StringBuilder sbISBN = new StringBuilder("");
if(dt.Rows.Count > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbISBN.Append("<ISBN VALUE=");
sbISBN.Append("\"" + dr["ISBN"].ToString() + "\"");
sbISBN.Append(" ID=");
sbISBN.Append("\"" + dr["AU_ID"].ToString() + "\"");
sbISBN.Append("/>");
}
StringBuilder sb = new StringBuilder("");
sb.Append("<?xml version=\"1.0\"?>");
sb.Append("<ROOT>");
sb.Append(sbISBN.ToString());
sb.Append("</ROOT>");
Response.Write(sb.ToString());
}
======================================================
I converted the below 2 sets of code into VB.net,with
conversion tools. I am getting a syntax error.
Can some one help me to convert the below code into
VB.net ?
I am building on the fly xml for xmlhttp to fill up the
drop downs. i have tested this in C# it is working fine.
------------------Set 1-----------------------------
strSQL = "Select Title from [Titles] Where ISBN = '" + Id
+ "'";
da = new OleDbDataAdapter(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"TitleName");
dt = ds.Tables[0];
StringBuilder sbTitle = new StringBuilder("");
if(dt.Rows.Count > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbTitle.Append("<TITLE VALUE=");
sbTitle.Append("\"" + dr["Title"].ToString() + "\"");
sbTitle.Append("/>");
}
StringBuilder sb = new StringBuilder("");
sb.Append("<?xml version=\"1.0\"?>");
sb.Append("<ROOT>");
sb.Append(sbTitle.ToString());
sb.Append("</ROOT>");
Response.Write(sb.ToString());
========================================================
-----------Set 2 ---------------------------------------
strSQL = "Select ISBN,Au_id from [Title Author] Where
Au_Id = " + Id;
da = new OleDbDataAdapter(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"ISBNList");
dt = ds.Tables[0];
StringBuilder sbISBN = new StringBuilder("");
if(dt.Rows.Count > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbISBN.Append("<ISBN VALUE=");
sbISBN.Append("\"" + dr["ISBN"].ToString() + "\"");
sbISBN.Append(" ID=");
sbISBN.Append("\"" + dr["AU_ID"].ToString() + "\"");
sbISBN.Append("/>");
}
StringBuilder sb = new StringBuilder("");
sb.Append("<?xml version=\"1.0\"?>");
sb.Append("<ROOT>");
sb.Append(sbISBN.ToString());
sb.Append("</ROOT>");
Response.Write(sb.ToString());
}
======================================================