|
What is it that you need help with, then?
---
b { font-weight: normal; }
|
|
|
|
|
this is my code for the insert
Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;data source=D:\\inetpub\wwwroot\purchasing\ReturnToVendor\2006 Shipping db.mdb"
Dim SQL2 As String = "Insert into ReturnToVendor (shippername, ponumber, ranumber, authorizedby, itemtoreturn, itemvalue, qtytoreturn, qtyunitofmeasure, reasonforreturn, actiontobetaken, notes, shipvia, rcicontact, contactdepartment, contactcostcenter, contactphonenumber, contactfaxnumber, carriername, Documentdate) values ('" & shippername.SelectedValue & "', '" & PONumber.Text & "', '" & ranumber.Text & "', '" & AuthorizedBy.Text & "', '" & ItemToReturn.Text & "', '" & ItemValue.Text & "', '" & qtyToReturn.Text & "', '" & qtyUnitofMeasure.SelectedValue & "', '" & reasonForReturn.Text & "', '" & ActiontoBeTaken.SelectedValue & "', '" & notes.Text & "', '" & shipvia.SelectedValue & "', '" & RCIContact.Text & "', '" & contactdepartment.Text & "', '" & contactcostcenter.Text & "', '" & ContactPhoneNumber.Text & "', '" & contactfaxnumber.Text & "', '" & carriername.Text & "', '" & Date.Today() & "')"
Dim dbConn2 As New OleDbConnection(connString)
Dim Cmd2 As New OleDbCommand(SQL2, dbConn2)
dbConn2.Open()
Cmd2.ExecuteNonQuery()
dbConn2.Close()
Response.Redirect("http://rfrmsweb/Purchasing/returntovendor/returntovendor3.aspx")
End Sub
how do I place the documentnumber in my insert statement to create the number in the table?
|
|
|
|
|
I'm not sure i'm understanding the quesiton but if you just want to insert the var documentnumber that you've created, add it just like the textboxes were added without the .text so '" & documentnumber & "' in the values, and whatever the column is named into the column list (in respective places of course). If you were (and probably are) asking about something else, try to specify the problem a little more.
Nathan Lindley
.NET Aficionado
|
|
|
|
|
what is wrong with this statement?
Dim DOCUMENTNUMBER As VariantType = "RTV-" & Format(Date.Today, "mmddyy") & "-" & Format(RecordID, "0000")
|
|
|
|
|
Syntax is fine. What is the exact error? When is it happening? On insert? If it is on insert step through it in visual studio and see what the value of the documentnumber is. Sorry the answer is vague, I still don't know what error you're getting.
Nathan Lindley
.NET Aficionado
|
|
|
|
|
Syntax is wrong.
Please try,
Dim DOCUMENTNUMBER As String = "RTV-" & Format(Date.Today, "MMddyy") & "-" & CType(RecordID, Double).ToString("0000")
|
|
|
|
|
I need to build the documentnumber in vb.net to the example below and write it to an access database. can anyone help? I have my insert working for all the other fields but this one.
documentnumber = "RTV-" & Format(Date.Today, "mmddyy") & "-" & Format(RecordID, "0000")
lewis
|
|
|
|
|
I'm trying to add sub menus to a context menu control in code (vb2005 express)(and read selection). Following code creates a vertical menu but I can't see how to add sub menues - then read selections?
I'm after somthing like:
Edit
......Cut
......Copy
......Paste
where the cut, copy and paste are extentions of the edit menu
to create:
ContextMenuStrip1.Items.Clear()
ContextMenuStrip1.Items.Add("Cut")
ContextMenuStrip1.Items.Add("Copy")
If Clipboard.ContainsText Or Clipboard.ContainsImage Then
ContextMenuStrip1.Items.Add("Paste")
End If
to read:
Private Sub ContextMenuStrip1_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip1.ItemClicked
Dim c As Control = ContextMenuStrip1.SourceControl
Dim s As String
' Check the source control first.
s = sender.GetType.ToString()
If Not (c Is Nothing) Then
Select Case c.GetType().ToString()
Case "System.Windows.Forms.TreeView"
Select Case c.Name 'ie TreeViewInformationList
Case "TreeViewInformationList"
RightClickActionTreeViewInformationList(e)
Case "TreeViewItem"
RightClickActionTreeViewItem(e)
etc
|
|
|
|
|
I have come across the same problem many times before. You have to create the context menu in the Visual Studio Form Designer.
|
|
|
|
|
How can i get the values in textbox to class
Please help me
the code is that:
Public Class islemler
.
.
Public Sub Calculate()
degisken2 = CDbl(textbox1.Text)
.
.
.
|
|
|
|
|
Get the values out of the textboxes first, then pass those to your class code:
Private Sub Button1_Click(blah, blah) Handles Button1.Click
Dim x As Double = Double.Parse(TextBox1.Text)
Result = Calcuate(x)
Public Class islemler
Public Function Calculate(ByVal d As Double) As Double
... do your calculation and return the result...
End Function
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all
Any one knows about a good converter to convert Vb6 to Vb 2005.
Appricated if you can provide a URL to download.
/Prash
|
|
|
|
|
There is only one and it's built right into VB.NET. All you have to do is open the old .VBP file for the conversion to launch. But, it's most definitely not perfect! There's just so many differences between VB6 and VB.NET, that the resulting code looks like something Dr. Frankenstein threw together. Your best option is to rewrite the app from scratch. But the conversion is at a least a decent starting point if you want to rewrite the app in stages.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have an old VB6 legacy app that I'm maintaining at a client. Basically a client app connects to a server app and then receives data. The client connects when the app is loaded and stays connected until the program closes.
I have to add some code to this app that will get the client app to reconnect to the server app if the connection is broken. If the connection is broken, or if it fails to connect, I start a timer that tries to connect every minute or so.
Here's the problem. When I connect on Page Load it connects fine. If the inital connect does'nt work and I try connect later on with the timer the connection gets stuck in state 6 (which is connecting) and it never actually connects.
Here's the code I use to connect on both page load and in the timer:
Private Sub ConnectToEventPub()
wsReader.remotehost = strRemoteHost
wsReader.RemotePort = 100
wsReader.Connect
While wsReader.State = 3 Or wsReader.State = 4 Or wsReader.State = 5 Or wsReader.State = 6
DoEvents 'wait for connection to complete
Wend
If wsReader.State = 7 Then 'if connected send info
wsReader.SendData (aService & "|" & aAbandonTime)
bISWinsockConnected = True
tmrReconnect.Enabled = False
Else
bISWinsockConnected = False
tmrReconnect.Enabled = True
End If
End Sub
The Sub works fine when called from Page Load but not when called from the timer.
Any ideas? I'm stumped and sitting in a freezing server room.
Capital Punishment means never having to say "you again?"
As easy as 3.141592653589793238462643383279502884197169
|
|
|
|
|
i want to make an asp.net page which will be called by a vb.net application witin a pc. this application will send the username and password to this asp.net page and retrieve information (true or false). if the username exists witin the database of the website (server) then the function will throw a true. how can i make this happen without any asp.net page opened?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
You don't want a web site, you want a web service. A web service is called over the web, can return a value to your code, and has no pages.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
how to make a web service pls?? can i make one??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
This[^] is the definitive site on the subject.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
This[^] should tell you a bit more about what web services are and point you in the right direction.
|
|
|
|
|
Hi, is there any good free, documention on visual BASIC express edition? I am doing an A level, and I want to get the programming out the way as soon as possible. OR, are there any free podcasts I could get that I could run on my IPOD(The original)? Thanks for any suggestions!
|
|
|
|
|
Do these use the same langauge? I ask because I was typing into my school progam ( visual BASIC 6 ) Form1.Print "Hello" and it worked then I typed the same thing into my express edition version, and it didn't work, why is this?
|
|
|
|
|
There is no such thing as visual basic express. Only Visual Studio express for VB.NET
Visual basic 6 is not 100% compatible with Visual Basic.NET
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Sorry, it says (On the top of the IDE) Microsoft Visual basic 2005 express edition. Can you tell me what the actual code should be for the VB.Net express edition?
|
|
|
|
|
VB6 is an old ( out dated and no longer supported ) non OO language that Microsoft has pretty much discarded. VB.NET Express is a free version of VB.NET 2005, which is a new, OO language that happens to use VB syntax. They are almost completely different from one another, your VB6 program will not work in VB.NET. Tell your school that VB6 is rubbish, it's dead, and VB.NET Express Edition is free. That's what they should be teaching you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Ok, does that mean, that the express edition I have is up to date and is the right one. I need to get books etc. for visual BASIC 2005?
|
|
|
|