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());
}
================================================== ==== 2 1898
I find a couple of problems with the code (when translating). In both
examples, if you put the first two lines together, you will find that the
syntax errors go away. In the first example, the "if" statement on line 8
is never terminated, so will generate an error there also.
HTH
David
"Neel" <an*******@discussions.microsoft.com> wrote in message
news:0d****************************@phx.gbl... 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()); } ================================================== ====
Thanx for the reply, I will try it -----Original Message----- I find a couple of problems with the code (when
translating). In bothexamples, if you put the first two lines together, you
will find that thesyntax errors go away. In the first example, the "if"
statement on line 8is never terminated, so will generate an error there also.
HTH
David
"Neel" <an*******@discussions.microsoft.com> wrote in
messagenews:0d****************************@phx.gbl... 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()); } ================================================== ====
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tim Johansson |
last post by:
I'm new to C++, and tried to start making a script that will shuffle an
array. Can someone please tell me what's wrong?
#include <iostream.h>
#include <string.h>
int main () {...
|
by: Michael Lehn |
last post by:
Hi,
I have a question regarding the conversion of objects. When is the
conversion done by the constructor and when by the operator. My feeling
tells me that the constructor is preferred. But...
|
by: Maurice |
last post by:
Folks
once again I look forward to your invaluable assistance.
When converting an Access 2002 mdb back to Access 1997 using the Access 2002
inbuilt tools I receive the following error message...
|
by: Steve Gough |
last post by:
Could anyone please help me to understand what is happening here? The
commented line produces an error, which is what I expected given that
there is no conversion defined from type double to type...
|
by: Harold Howe |
last post by:
Howdy all,
I am getting a compiler error regarding a consrained conversion. It
complains that it can't make the type conversion, even though the
generic type argument inherits from the target of...
|
by: Dhirendra Singh |
last post by:
Hi,
The following C++ program is not compiling on my system.
#include <iostream>
using namespace std;
class complex {
double re, im;
public:
complex( ) :re(0), im(0) {}
|
by: Martin Jørgensen |
last post by:
Hi,
I've had a introductory C++ course in the spring and haven't programmed in
C++ for a couple of months now (but I have been programmed in C since
january). So I decided to do my conversion...
|
by: jyck91 |
last post by:
// Base Conversion
// Aim: This program is to convert an inputted number
// from base M into base N. Display the converted
// number in base N.
#include <stdio.h>
#include <stdlib.h>...
|
by: fazulu deen |
last post by:
Hi all,
For the following code :
file_ptr = fopen("pass_fail.txt", "a"); // error line 393
fdisplay(file_ptr, "Test Passed");
fclose(file_ptr);
|
by: Rahul |
last post by:
Hi Everyone,
I have the following code,
class B;
class A
{
public : operator B();
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |