473,698 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET Conversion Error

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 OleDbDataAdapte r(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"Tit leName");
dt = ds.Tables[0];
StringBuilder sbTitle = new StringBuilder(" ");
if(dt.Rows.Coun t > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbTitle.Append( "<TITLE VALUE=");
sbTitle.Append( "\"" + dr["Title"].ToString() + "\"");
sbTitle.Append( "/>");
}
StringBuilder sb = new StringBuilder(" ");
sb.Append("<?xm l version=\"1.0\" ?>");
sb.Append("<ROO T>");
sb.Append(sbTit le.ToString());
sb.Append("</ROOT>");
Response.Write( sb.ToString());
=============== =============== =============== ===========
-----------Set 2 ---------------------------------------
strSQL = "Select ISBN,Au_id from [Title Author] Where
Au_Id = " + Id;
da = new OleDbDataAdapte r(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"ISB NList");
dt = ds.Tables[0];
StringBuilder sbISBN = new StringBuilder(" ");
if(dt.Rows.Coun t > 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("<?xm l version=\"1.0\" ?>");
sb.Append("<ROO T>");
sb.Append(sbISB N.ToString());
sb.Append("</ROOT>");
Response.Write( sb.ToString());
}
=============== =============== =============== =========
Jul 21 '05 #1
2 1917
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*******@disc ussions.microso ft.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 OleDbDataAdapte r(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"Tit leName");
dt = ds.Tables[0];
StringBuilder sbTitle = new StringBuilder(" ");
if(dt.Rows.Coun t > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbTitle.Append( "<TITLE VALUE=");
sbTitle.Append( "\"" + dr["Title"].ToString() + "\"");
sbTitle.Append( "/>");
}
StringBuilder sb = new StringBuilder(" ");
sb.Append("<?xm l version=\"1.0\" ?>");
sb.Append("<ROO T>");
sb.Append(sbTit le.ToString());
sb.Append("</ROOT>");
Response.Write( sb.ToString());
=============== =============== =============== ===========
-----------Set 2 ---------------------------------------
strSQL = "Select ISBN,Au_id from [Title Author] Where
Au_Id = " + Id;
da = new OleDbDataAdapte r(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"ISB NList");
dt = ds.Tables[0];
StringBuilder sbISBN = new StringBuilder(" ");
if(dt.Rows.Coun t > 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("<?xm l version=\"1.0\" ?>");
sb.Append("<ROO T>");
sb.Append(sbISB N.ToString());
sb.Append("</ROOT>");
Response.Write( sb.ToString());
}
=============== =============== =============== =========

Jul 21 '05 #2
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*******@disc ussions.microso ft.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 OleDbDataAdapte r(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"Tit leName");
dt = ds.Tables[0];
StringBuilder sbTitle = new StringBuilder(" ");
if(dt.Rows.Coun t > 0)
{
foreach(DataRow dr in dt.Rows)
{
sbTitle.Append( "<TITLE VALUE=");
sbTitle.Append( "\"" + dr["Title"].ToString() + "\"");
sbTitle.Append( "/>");
}
StringBuilder sb = new StringBuilder(" ");
sb.Append("<?xm l version=\"1.0\" ?>");
sb.Append("<ROO T>");
sb.Append(sbTit le.ToString());
sb.Append("</ROOT>");
Response.Write( sb.ToString());
=============== =============== =============== ===========
-----------Set 2 ---------------------------------------
strSQL = "Select ISBN,Au_id from [Title Author] Where
Au_Id = " + Id;
da = new OleDbDataAdapte r(strSQL,conn);
ds = new DataSet();
da.Fill(ds,"ISB NList");
dt = ds.Tables[0];
StringBuilder sbISBN = new StringBuilder(" ");
if(dt.Rows.Coun t > 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("<?xm l version=\"1.0\" ?>");
sb.Append("<ROO T>");
sb.Append(sbISB N.ToString());
sb.Append("</ROOT>");
Response.Write( sb.ToString());
}
=============== =============== =============== =========

.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
5049
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 () { srand(time(0)); int array_length; int count;
7
3256
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 I couldn't find the exact rule in the C++ standard. And what if the classes have template parameters? It would be great if somebody could get me a rough hint where in the
2
2221
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 "Some errors happened during the conversion. No converted database was generated". This message is not of great assistance to me in sorting out the error!! I have not been able to find any helpful support on where to start looking
11
7610
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 Test. I expected the same error from the following line, but it compiles fine. The double is silently truncated to an int and then fed in to the implicit conversion operator. Why does this happen? Is there any way that I can keep the implicit...
2
1529
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 the conversion. I have trimmed my source down as much as possible. The classes implement something that behaves sort of like the Mediator design pattern, but where the colleagues are abstract, and can be added or removed on the fly. I guess...
6
2803
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) {}
31
3135
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 utility in C++, before I forget everything. But it doesn't compile: ------------
11
2699
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> #include <string.h> #define LENGTH 20 int temp, m, n, i, r, base10, true;
3
7156
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);
6
2634
by: Rahul | last post by:
Hi Everyone, I have the following code, class B; class A { public : operator B();
0
9170
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.