Click here to Skip to main content
15,900,110 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Need help designing label and envelope prinitng in vb Pin
DanB198319-Sep-07 22:02
DanB198319-Sep-07 22:02 
QuestionDAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd19-Sep-07 20:08
professionalVimalsoft(Pty) Ltd19-Sep-07 20:08 
AnswerRe: DAll And BLL Template Question Pin
Colin Angus Mackay20-Sep-07 0:10
Colin Angus Mackay20-Sep-07 0:10 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 1:49
professionalVimalsoft(Pty) Ltd20-Sep-07 1:49 
GeneralRe: DAll And BLL Template Question Pin
Colin Angus Mackay20-Sep-07 2:33
Colin Angus Mackay20-Sep-07 2:33 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 2:50
professionalVimalsoft(Pty) Ltd20-Sep-07 2:50 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 3:55
professionalVimalsoft(Pty) Ltd20-Sep-07 3:55 
GeneralRe: DAll And BLL Template Question Pin
Colin Angus Mackay20-Sep-07 4:23
Colin Angus Mackay20-Sep-07 4:23 
Vuyiswamb wrote:
On this one i need your help, i got Stucked. the Code Complained in the Following line.


Dim DataAdapter As New SqlDataAdapter(BuildBasicQuery("GetInvoice" _
, "@invoiceNumber", invoiceNumber))


BuildBasicQuery returns a SqlDataAdapter already, so passing it as an argument to the constructor of SqlDataAdapter is likey to cause problems. You don't need to call the constructor again as you already have an instance of the object.

So the line of code should be something like this:
Dim dataAdapter As SqlDataAdapter = BuildBasicQuery("GetInvoice")


Also note that BuildBasicQuery only takes one parameter, the name of the stored procedure. You add the parameters afterwards.


Vuyiswamb wrote:
The Compiler Complained about All the lines in this Function.


VB is not supposed to be case sensitive, but that is because the IDE sorts that out for you. Perhaps that is the problem. dim should be Dim, etc.

Vuyiswamb wrote:
Dim cmd As New SqlCommand(BuildCommand("CreateInvoice"))


Again, BuildCommand returns a command object already. No need to create a new one.

Vuyiswamb wrote:
cmd.Parameters.AddWithValue("@billingAddressId") billingAddressId)


You have closed the bracket too early. Replace it with a comma and underscore to allow the code to progress to the next line.


Vuyiswamb wrote:
int result = (int)cmd.ExecuteScalar()
i Think i you can confirm my Code, i will try to understand.


Now, this is one thing I don't know how to do in VB. (int) is the casting operator. In this case it is casting to an integer. ExecuteScalar returns an object, so it can be any type that is being returned. The code requires it to be an integer, so that is what it must be cast to.

I hope this helps.

I also hope that you are looking at the sematics (the meaning of the code) as well as the syntax (the grammar). So far you seem to have been concentrating on the syntax - which may be fine if it is easier for you to understand in VB.NET.


Upcoming FREE developer events:
* Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ...

My website

GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 5:28
professionalVimalsoft(Pty) Ltd20-Sep-07 5:28 
GeneralRe: DAll And BLL Template Question Pin
Dave Kreskowiak20-Sep-07 4:33
mveDave Kreskowiak20-Sep-07 4:33 
GeneralRe: DAll And BLL Template Question Pin
Dave Kreskowiak20-Sep-07 4:48
mveDave Kreskowiak20-Sep-07 4:48 
GeneralRe: DAll And BLL Template Question Pin
Vimalsoft(Pty) Ltd20-Sep-07 5:20
professionalVimalsoft(Pty) Ltd20-Sep-07 5:20 
QuestionRunning two projects as one application Pin
saaaas19-Sep-07 17:52
saaaas19-Sep-07 17:52 
AnswerRe: Running two projects as one application Pin
Christian Graus19-Sep-07 18:19
protectorChristian Graus19-Sep-07 18:19 
QuestionExcel - How to read data from an XML file... Pin
Albert Giraudi19-Sep-07 16:37
Albert Giraudi19-Sep-07 16:37 
AnswerRe: Excel - How to read data from an XML file... Pin
Gary Bigman19-Sep-07 21:16
Gary Bigman19-Sep-07 21:16 
GeneralRe: Excel - How to read data from an XML file... Pin
Albert Giraudi20-Sep-07 16:13
Albert Giraudi20-Sep-07 16:13 
QuestionForm Load Pin
Jodd19-Sep-07 14:04
Jodd19-Sep-07 14:04 
AnswerRe: Form Load Pin
Luc Pattyn19-Sep-07 15:42
sitebuilderLuc Pattyn19-Sep-07 15:42 
GeneralRe: Form Load Pin
Jodd19-Sep-07 22:51
Jodd19-Sep-07 22:51 
AnswerRe: Form Load Pin
helelark12319-Sep-07 20:21
helelark12319-Sep-07 20:21 
AnswerRe: Form Load Pin
Tom Deketelaere19-Sep-07 20:43
professionalTom Deketelaere19-Sep-07 20:43 
GeneralRe: Form Load Pin
Jodd19-Sep-07 22:52
Jodd19-Sep-07 22:52 
QuestionVB 6 and VB.net 2003 Network objects Pin
Phill_Goin19-Sep-07 12:27
Phill_Goin19-Sep-07 12:27 
AnswerRe: VB 6 and VB.net 2003 Network objects Pin
Gary Bigman19-Sep-07 22:14
Gary Bigman19-Sep-07 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.