|
It would appear that VB can't swallow extra brackets.
change
(CType(WebBrowser.Document, HTMLDocument)).body.innerHTML
to
CType(WebBrowser.Document, HTMLDocument).body.innerHTML
Read this article: http://www.codeproject.com/dotnet/CheatSheetCastingNET.asp[^]
It looks to me like you should use DirectCast, not CType.
In any case, you're obviously out of your depth. Put this book on the shelf until you are able to understand what the code does, through reading a more basic book. Typing stuff you don't understand out of books is neither programming, or educational.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
ty for your help christian I suppose you're right the name of the book is called network programming in.net is step-by-step and explains what is what as you go, but as you can see. It's not working that well will anyway. Thank you for your help Delo
|
|
|
|
|
Christian I understand what you are trying to tell me what I find it easier to go through a book and write the sample programs, and then see what they do. And then examining the code it seems to be easier for me to learn this way or example. A module I learned that if I needed to write code that was repetitive. I could simply do it in a module, and if I gave it the name sub, whatever than in any new program that I wrote that I could use this module than simply behind the button type the code whenever different people learn different ways Christian. Is there a book out there that you are familiar with that is not Microsoft Visual Basic.net step-by-step designing enterprise application with Microsoft Visual Basic.net or programming Microsoft Visual Basic.net. And of course we know the other one network programming in.net. Any information you may have on this would be greatly appreciated. Thank you again Delo
|
|
|
|
|
Sorry, I don't like Visual Basic. I own no books on it. I help here because I can, because VB and C# use the same libraries. I'm sure there is a VB.NET for dummies or VB.NET in 24 hours. That's not an insult, those books are just written to take things as slowly as possible for an absolute beginner. My first ever book was Visual C++ in 24 hours, and it was a great way to start.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi: I really don't know which line it is on. All I was told was that something was not defined corectly. I looked over the rest of the code and initialized the variables to zero and 0.00 where needed. Other than that I really don't know where to look. I do know that this is the subroutine where the error is happening.
I was trying to put a line number or error number on the error message at the bottom but I couldn't find the syntax for the error code in order to capture it.
Thanks again
PS. This is supposed to be a simple add, delete record program, no special effects thing.
|
|
|
|
|
Try putting a try/catch around the code that's blowing up, but create variables outside the block. Then put a break point in the catch, and check what the values of the variables are. That should get you on the track to figure out what's going on. Remember that all numeric variables have a max and min possible value, which are defined by constants you can access of the type, as in int.maxvalue.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i hv a task abt booking appointment and i get stuck on it...can anyone help me to code it out in VB.NET???....
Below is the booking process flow:
1. Booking appointment: MemberApptForm.aspx
-There is a drop-down list for time (probably in hours) and a Calendar for date picking.
-Validation:
a)If date is on holiday, reject.
b)If date is ok, time is free from appointment (no record in database), allow appointment to be saved
(set booking status to 0).
c)If date is ok, time is booked by other users and current date is greater than 3 days, place pending appointment (set booking status to 0,1,2 and so forth).
i.e.-if the user cancel the appointment is with booking status 1, email will be sent to the user (same time & date) with booking status 2.
2. Cancel appointment
a) Remove the record of the user from the appointment table.
b) result:
- Return appointment Canceled.
- Send email to the user with Appointment status of the user with the precedent record with same date & time.
c) In other words, the user that will hold the appointment right is the one with the lowest number of booking status.
that's all for the process, so pls help me!!! i'm in urgent now...thanx..
|
|
|
|
|
Welcome to school. This is the bit where they give you homework, and you learn by doing it yourself. IF you want to cheat your way through school, have the decency to do it at rentacoder, where you will at least pay to be dishonest.
Or, you can do your own homework and ask for help when you get stuck.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
Dim i As Integer
Dim sql As String
Dim dt As String
Dim tm As String
dt = txtDate.Text
tm = ddlTime.SelectedItem.Value
dt = Right(dt, 4) & "-" & Mid(dt, 4, 2) & "-" & Left(dt, 2)
Dim dsn As String = ConfigurationSettings.AppSettings("dsn")
Dim conn As New SqlClient.SqlConnection(dsn)
Dim cmd As New SqlClient.SqlCommand(sql, conn)
conn.Open()
Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader()
If dr("AppDate").ToString() = True Then
sql = "insert into appointments values (" & Session("userid")
sql = sql & ", getdate(), '" & dt & " " & tm & "'"
sql = sql & ",'" & txtPetName.Text & "','" & txtVet.Text & "'"
sql = sql & ",'" & Replace(txtServiceDesc.Text, "'", "''") & "','CONFIRM')"
cmd.Connection.Open()
cmd.ExecuteNonQuery()
conn.Close()
Response.Redirect("MemberPage.aspx")
Else
lblResult.Text = "pls choose another date"
End If
End Sub
This is all about my code but always a error "ExecuteReader: CommandText property has not been initialized" for the line "Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader()"..
|
|
|
|
|
gwyn729 wrote:
Dim cmd As New SqlClient.SqlCommand(sql, conn)
sql does not contain a value at this point.
This code:
sql = "insert into appointments values (" & Session("userid")
sql = sql & ", getdate(), '" & dt & " " & tm & "'"
sql = sql & ",'" & txtPetName.Text & "','" & txtVet.Text & "'"
sql = sql & ",'" & Replace(txtServiceDesc.Text, "'", "''") & "','CONFIRM')" needs to be move to before you create your SqlCommand object.
Also, the code you have for building your SQL has security flaws (I am hoping that this is in a future lesson and for the moment you don't know any better). If you want to read more about how to prevent SQL Injection Attacks I suggest you might take a look here: http://www.codeproject.com/useritems/SqlInjectionAttacks.asp[^]
Does this help?
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
I converted a vb5 to vb.net application and I can run on my machine but I get this error when trying to launch on another machine?
Common Language Runtime Debugging Services
Any thoughts?
CNC programmer
|
|
|
|
|
is it possible to get all office 2003 toolbar images in a file and how?
|
|
|
|
|
CTRL-PrtScn, open Paint, CTRL-V
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hi There,
im trying to do something like this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyThread As New System.Threading.Thread(AddressOf doloop)
MyThread.Start()
Button1.Enabled = False
End Sub
The problem i face is, how can i detect that the MyThread has finished so i can enable Button1 again?
Thanks in Advance
Mahmoud Manasrah
|
|
|
|
|
Do it from the thread....use a Delegate function.
|
|
|
|
|
can u give more details or a sample code?
Thanks in Advance
Mahmoud Manasrah
|
|
|
|
|
In your form class....
<br />
Private Delegate Sub dlgButtonOff()<br />
Private Delegate Sub dlgButtonOn()<br />
<br />
Private Sub Button1Off()<br />
Button1.Enabled = False<br />
End Sub<br />
<br />
Private Sub Button1On()<br />
Button1.Enabled = True<br />
End Sub<br />
In the Thread......
<br />
' Turns the button off. <br />
Dim buttonOff As New dlgButtonOff(AddressOf Button1Off)<br />
Me.Invoke(buttonOff)<br />
<br />
' Turns the button on again.<br />
Dim buttonOn As New dlgButtonOn(AddressOf Button1On)<br />
Me.Invoke(buttonOn)<br />
If you want a complete code example, let me know.
|
|
|
|
|
How can I specified the path so that my ini file
can be saved into the current user folder(under Documents and Settings)
in VB6?
|
|
|
|
|
Below is the piece of code that caused the error: I'm new a this language and I cannot see where it is wrong. Thanks for your help.
Public Function newr() As String
Try
Dim dbCommand As OleDbCommand
Dim DBConn As OleDbConnection
Dim DBInsert As New OleDbCommand
Dim strDsc, strVin, strMak, strMod, strEng, strTrn As String
Dim strCol, strTx1, strTx2, strTx3, strTx4, strTx5 As String
Dim strTx6, strPur, strCnt, strCom As String
Dim intYr, intQty, intMil, intPph As Integer
Dim curPrc, curSal As Double
Dim curCst, curFrt, curDet, curLot As Double
Dim curC1, curC2, curC3, curC4, curC5, curC6, curTCt As Double
Dim datPur, datLot As Date
Dim strPath As String
Dim USA As String
strDsc = txtDesc.Text
strVin = txtVin.Text
strMak = txtMake.Text
strMod = txtMod.Text
strEng = txtEngine.Text
strTrn = txtTrans.Text
strCol = txtColor.Text
strTx1 = txtT1.Text
strTx2 = txtT2.Text
strTx3 = txtT3.Text
strTx4 = txtT4.Text
strTx5 = txtT5.Text
'strTx6 = txtT6.Text
strPur = txtPurf.Text
strCnt = txtCont.Text
strCom = txtCom.Text
intPph = CInt(txtPph.Text)
intYr = CInt(txtYear.Text)
intQty = CInt(txtQty.Text)
intMil = CInt(txtMiles.Text)
curPrc = CDbl(txtPrice.Text)
curSal = CDbl(txtSale.Text)
curCst = CDbl(txtCost.Text)
curFrt = CDbl(txtFrt.Text)
curDet = CDbl(txtDetail.Text)
curLot = CDbl(txtLot.Text)
curC1 = CDbl(txtC1.Text)
curC2 = CDbl(txtC2.Text)
curC3 = CDbl(txtC3.Text)
curC4 = CDbl(txtC4.Text)
curC5 = CDbl(txtC5.Text)
'curC6 = txtC6.Text
curTCt = CDbl(txtTCst.Text)
datPur = DateValue(txtPdat.Text)
datLot = DateValue(txtDlot.Text)
USA = "USA"
DBConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
& "DATA SOURCE=" _
& strPath)
DBInsert.CommandText = "Insert Into Equip " _
& "(ADesc, AVin, AMake, AModel, AYear, AColor, AEngine, ATrans, AMiles, AQty, ACost, APrice, AActual, ASale, AFrt, ADetail,ALot, AT1, AT2, AT3, AT4, AT5, AT6, AT7, AT8, AT9, AT0, AC1, AC2, AC3, AC4, AC5, AC6, AC7, AC8, AC9, AC0, APFrom, APDat, APCont, APph, APDLot, ACom, AUSA) " _
& "Values (" _
& "'" & strDsc & "', " _
& "'" & strVin & "', " _
& "'" & strMak & "', " _
& "'" & strMod & "', " _
& "'" & intYr & "', " _
& "'" & strCol & "', " _
& "'" & strEng & "', " _
& "'" & strTrn & "', " _
& "'" & intMil & "', " _
& "'" & intQty & "', " _
& "'" & curCst & "', " _
& "'" & curPrc & "', " _
& "'" & curTCt & "', " _
& "'" & curSal & "', " _
& "'" & curFrt & "', " _
& "'" & curDet & "', " _
& "'" & curLot & "', " _
& "'" & strTx1 & "', " _
& "'" & strTx2 & "', " _
& "'" & strTx3 & "', " _
& "'" & strTx4 & "', " _
& "'" & strTx5 & "', " _
& "'" & strTx6 & "', " _
& "'" & strTx6 & "', " _
& "'" & strTx6 & "', " _
& "'" & strTx6 & "', " _
& "'" & strTx6 & "', " _
& "'" & curC1 & "', " _
& "'" & curC2 & "', " _
& "'" & curC3 & "', " _
& "'" & curC4 & "', " _
& "'" & curC5 & "', " _
& "'" & curC6 & "', " _
& "'" & curC6 & "', " _
& "'" & curC6 & "', " _
& "'" & curC6 & "', " _
& "'" & curC6 & "', " _
& "'" & strPur & "', " _
& "'" & datPur & "', " _
& "'" & strCnt & "', " _
& "'" & intPph & "', " _
& "'" & datLot & "', " _
& "'" & strCom & "', " _
& "'" & USA & "')"
DBInsert.Connection = DBConn
DBInsert.Connection.Open()
DBInsert.ExecuteNonQuery()
DBConn.Close()
txtError.Text = "Saved."
Catch err As System.Exception
txtError.Text = err.Message
End Try
End Function
|
|
|
|
|
:SMACK: And the error is? And on what line?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Defined the items correctly, then I run it. After I enter data and hit save. I get this error. I was told to recheck the definitaions, which I did and I still get this error. Does anyone now where to look?
|
|
|
|
|
Not without you supplying A LOT more information than this. What are supposed to do with the complete lack of information in your post?
Post a snippet of your code and the error message and we might be able to tell you something helpful.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need some help with sending email via MS Outlook, using VB.NET. What I want is for the program to send the email, using the email addess provided by the user and then send the email, without any interaction from the user.
I get it more or less, BUT - everytime MS Outlook gives me a message - 'an program is trying to send an email message, do you want to continue'. How can I overcome this problem - at the end of the day I don't want any interaction between the user and outlook.
Any help will be much appreciated...
|
|
|
|
|
Isnt that an SP2 thing? Its trying to protect the machine against a mail list exploit. I dont think that you would really WANT to turn that off these days. Not with the Netsky crap going on.
|
|
|
|
|
You have to go into Outlook Express to turn this off. You find it under the Tool/Options menus, Security tab. It's not an XP SP2 thing. It's been around for a couple of years now in Outlook.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|