|
Ok, first of all, what project are you running? Is it a Window application? Or is it a console Application? Where is your entry point into the app?
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
Hello Nick
I am running a Windows Application Project. I have not programmed in VB before, and what I have is the latest VB.NET software loaded on my machine. I am trying to teach myself VB.NET, but too bad the starting point seems to be quite difficult. Can I teach myself the basics of VB using VB.NET?
|
|
|
|
|
Don't worry about it. VB.Net is quite easy once you get the hang of it
OK, regarding your question. In VB.Net, there are 2 possible points of entry in an application, A windows form, or a Sub Main. To set either one, go to your Solution Explorer, Right-click on your Project and choose properties. Look for the "Startup Object" properties and it's corresponding Combobox, which will list any "Sub Main" and windows form in your application. Choose any one to have your program "start" from that point.
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
Hi there,
I just started programming in VB.NET. i am working on asp.net and using VB.NET. I have a log in screen and when the user clicks on it it should go to a results.aspx page. please suggest me the code that i need to write in the button click event.
thanks in advance
|
|
|
|
|
Response.Redirect(page)
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
Hello,
I am unable to get my combobox to load.
I have the user iner or scan a number into the textbox.
This calls a procedure and walla.....My CB should populate
but no. Can someone give me some suggestions from my code?
I get an object required error right here
Also, how can I get it to accept a scan instead of a user
hitting enter after entering the data?
Thank you very much.
Dim batchnumber As String
Dim GetBatchNO As Integer
strValue = Trim(UCase(txtbatchnum.Text))
Me.MousePointer = vbNormal
If strValue = 0 Then
MsgBox ("Invalid Batch Number!")
txtbatchnum_GotFocus
Me.MousePointer = vbNormal
Exit Sub
End If
txtbatchnum.Text = GetBatchNO
'ado.dbo_ShippingGetTnocwayFromBatchno GetBatchNO
batchnumber = Trim(ado.rsdbo_ShippingGetTnocwayFromBatchno!Tnocway) & ""
ado.rsdbo_ShippingGetTnocwayFromBatchno.Close
comboTnum.Clear
Do While Not ado.rsdbo_ShippingGetTnocwayFromBatchno.EOF
comboTnum.AddItem batchnumber
ado.rsdbo_ShippingGetTnocwayFromBatchno.MoveNext
Loop
End Sub
|
|
|
|
|
Hi all,
I have been in the IT industry for nearly 10 yrs now, and have no programming skills at all. Finally decided to bite the bullet and throw myself into it head first. However, I haven't tried programming since I was 18, some 12 years ago, and my current financial situation means purchasing books, etc. is out of the question. So, if there are any nice people out there who think they can help me, please get in contact.. Any help would be greatly appreciated, however little....
Cheers everyone..
Matt
|
|
|
|
|
hi,
i am currently facing a title separation (Station 1) difficulties in printing on the same page.
req output:
Station: 1 (combobox value)
data
data
data
Station: 2 (combobox value)
data
data
data
data
how to capture the range value and separte into the above output?
can anybody help......i have been struggling for some time
thanks.
|
|
|
|
|
I got this BASIC code from an old book, I am converting this to c, could somebody tell me what is "On NTY GoTo 610, 620, 680, 690" function is? I know that is to go to line 610,620,680,690. but what are the conditions for that?
what about " !" in here?, In c if it is "!=" that is not equal to, but what about here? It canot be factorial number.
NTY = ITYPE(I): KP = 4 * (I - 1) + 1
600 On NTY GoTo 610, 620, 680, 690
610 R = ELEM(KP): GoTo 660
620 REY = ELEM(KP + 1) * Abs(Q(I)): If REY < 1! Then REY = 1!
630 If REY < 2000 ! Then GoTo 640 Else GoTo 650
640 R = ELEM(KP) * 64 ! / REY: GoTo 660
650 R = ELEM(KP) * 1.325 / (Log(ELEM(KP + 2) + 5.74 / REY ^ 0.9)) ^ 2
660 DH = DH + S(J) * R * Q(I) * Abs(Q(I)) ^ EN
670 HDQ=HDQ+EX*R*ABS(Q(I))^EN GOTO 710
680 DH = DH + S(J) * ELEM(KP): GoTo 710
690 DH = DH - S(J) * E(LEM(KP) + Q(I) * (ELEM(KP + 1) + Q(I) * (ELEM(KP + 2) + Q(I) * ELEM(KP + 3))))
thanks in advance
shanila
|
|
|
|
|
as I recall
On NTY GoTo 610, 620, 680, 690 statement tests NTY and jumps to 610 if NTY=1 , 620 if NTY=2 etc.
in VB6 ! meens that the number is single.
but in GWBasic I used to see it if I write a huge number (the editor adds it)
|
|
|
|
|
I am very new to Visual Basic 6, so forgive me if this is not the appropriate forum for this question.
I am building a form that has a text box that will hold hexadecimal data. I want to be able to take this data and display it seperate boxes of 2 characters. I know this can be done using Left(textName, 2) and also Mid(textName, 3, 2) but I can't seem to make it work.
Example: Text Box with this data: 22AB3F3202
That would yield text boxes with this: 22 AB 3F 32 02
I hope I made what I need clear and that someone can help me.
Thank you!
|
|
|
|
|
While there are a number of different ways you can do this, here is just a quick example:
Dim str, buff As String
str = Me.TextBox1.Text
Do While Len(str)
buff = Left(str, 2)
ListBox1.AddItem (buff)
str = Right(str, Len(str) - 2)
Loop
You can obviously remove the listbox instruction, this is only an example. Hope this helps.
-Nick Parker
|
|
|
|
|
plz post some code so we can help
|
|
|
|
|
I finally got it to work using the following code. It's probably not the most efficient code, so if there is a better way, please let me know.
Private Sub txtCMD_Change()
Dim Length As String
Dim Hash As String
Dim Code2 As String
Dim Code3 As String
Dim Code4 As String
Dim Code5 As String
Dim Code6 As String
Dim Code7 As String
Dim Code8 As String
Dim Code9 As String
Dim Code10 As String
Dim Code11 As String
Dim Code12 As String
Dim Code13 As String
Dim Code14 As String
Dim Code15 As String
Dim Code16 As String
Dim Code17 As String
Dim Code18 As String
Dim Code19 As String
Dim Code20 As String
Dim Code21 As String
Dim Code22 As String
Dim Code23 As String
Dim Code24 As String
Dim Code25 As String
Dim Code26 As String
Dim Code27 As String
Dim Code28 As String
Dim Code29 As String
Dim Code30 As String
Dim Code31 As String
Dim Code32 As String
Dim Code33 As String
Dim Code34 As String
Dim Code35 As String
Dim Code36 As String
Dim Code37 As String
Dim Code38 As String
Dim Code39 As String
Dim Code40 As String
Dim Code41 As String
Dim Code42 As String
Dim Code43 As String
Dim Code44 As String
Dim Code45 As String
Dim Code46 As String
Dim Code47 As String
Dim Code48 As String
Dim Code49 As String
Length = txtCMDLength.Text
Hash = txtHashRange.Text
Code2 = Hex2.Text
Code3 = Hex3.Text
Code4 = Hex4.Text
Code5 = Hex5.Text
Code6 = Hex6.Text
Code7 = Hex7.Text
Code8 = Hex8.Text
Code9 = Hex9.Text
Code10 = Hex10.Text
Code11 = Hex11.Text
Code12 = Hex12.Text
Code13 = Hex13.Text
Code14 = Hex14.Text
Code15 = Hex15.Text
Code16 = Hex16.Text
Code17 = Hex17.Text
Code18 = Hex18.Text
Code19 = Hex19.Text
Code20 = Hex20.Text
Code21 = Hex21.Text
Code22 = Hex22.Text
Code23 = Hex23.Text
Code24 = Hex24.Text
Code25 = Hex25.Text
Code26 = Hex26.Text
Code27 = Hex27.Text
Code28 = Hex28.Text
Code29 = Hex29.Text
Code30 = Hex30.Text
Code31 = Hex31.Text
Code32 = Hex32.Text
Code33 = Hex33.Text
Code34 = Hex34.Text
Code35 = Hex35.Text
Code36 = Hex36.Text
Code37 = Hex37.Text
Code38 = Hex38.Text
Code39 = Hex39.Text
Code40 = Hex40.Text
Code41 = Hex41.Text
Code42 = Hex42.Text
Code43 = Hex43.Text
Code44 = Hex44.Text
Code45 = Hex45.Text
Code46 = Hex46.Text
Code47 = Hex47.Text
Code48 = Hex48.Text
Code49 = Hex49.Text
Length = UCase(Mid(txtCMD, 3, 2))
txtCMDLength = Length
Hash = UCase(Mid(txtCMD, 11, 4))
txtHashRange = Hash
Code2 = UCase(Mid(txtCMD, 3, 2))
Hex2 = Code2
Code3 = UCase(Mid(txtCMD, 5, 2))
Hex3 = Code3
Code4 = UCase(Mid(txtCMD, 7, 2))
Hex4 = Code4
Code5 = UCase(Mid(txtCMD, 9, 2))
Hex5 = Code5
Code6 = UCase(Mid(txtCMD, 11, 2))
Hex6 = Code6
Code7 = UCase(Mid(txtCMD, 13, 2))
Hex7 = Code7
Code8 = UCase(Mid(txtCMD, 15, 2))
Hex8 = Code8
Code9 = UCase(Mid(txtCMD, 17, 2))
Hex9 = Code9
Code10 = UCase(Mid(txtCMD, 19, 2))
Hex10 = Code10
Code11 = UCase(Mid(txtCMD, 21, 2))
Hex11 = Code11
Code12 = UCase(Mid(txtCMD, 23, 2))
Hex12 = Code12
Code13 = UCase(Mid(txtCMD, 25, 2))
Hex13 = Code13
Code14 = UCase(Mid(txtCMD, 27, 2))
Hex14 = Code14
Code15 = UCase(Mid(txtCMD, 29, 2))
Hex15 = Code15
Code16 = UCase(Mid(txtCMD, 31, 2))
Hex16 = Code16
Code17 = UCase(Mid(txtCMD, 33, 2))
Hex17 = Code17
Code18 = UCase(Mid(txtCMD, 35, 2))
Hex18 = Code18
Code19 = UCase(Mid(txtCMD, 37, 2))
Hex19 = Code19
Code20 = UCase(Mid(txtCMD, 39, 2))
Hex20 = Code20
Code21 = UCase(Mid(txtCMD, 41, 2))
Hex21 = Code21
Code22 = UCase(Mid(txtCMD, 43, 2))
Hex22 = Code22
Code23 = UCase(Mid(txtCMD, 45, 2))
Hex23 = Code23
Code24 = UCase(Mid(txtCMD, 47, 2))
Hex24 = Code24
Code25 = UCase(Mid(txtCMD, 49, 2))
Hex25 = Code25
Code26 = UCase(Mid(txtCMD, 51, 2))
Hex26 = Code26
Code27 = UCase(Mid(txtCMD, 53, 2))
Hex27 = Code27
Code28 = UCase(Mid(txtCMD, 55, 2))
Hex28 = Code28
Code29 = UCase(Mid(txtCMD, 57, 2))
Hex29 = Code29
Code30 = UCase(Mid(txtCMD, 59, 2))
Hex30 = Code30
Code31 = UCase(Mid(txtCMD, 61, 2))
Hex31 = Code31
Code32 = UCase(Mid(txtCMD, 63, 2))
Hex32 = Code32
Code33 = UCase(Mid(txtCMD, 65, 2))
Hex33 = Code33
Code34 = UCase(Mid(txtCMD, 67, 2))
Hex34 = Code34
Code35 = UCase(Mid(txtCMD, 69, 2))
Hex35 = Code35
Code36 = UCase(Mid(txtCMD, 71, 2))
Hex36 = Code36
Code37 = UCase(Mid(txtCMD, 73, 2))
Hex37 = Code37
Code38 = UCase(Mid(txtCMD, 75, 2))
Hex38 = Code38
Code39 = UCase(Mid(txtCMD, 77, 2))
Hex39 = Code39
Code40 = UCase(Mid(txtCMD, 79, 2))
Hex40 = Code40
Code41 = UCase(Mid(txtCMD, 81, 2))
Hex41 = Code41
Code42 = UCase(Mid(txtCMD, 83, 2))
Hex42 = Code42
Code43 = UCase(Mid(txtCMD, 85, 2))
Hex43 = Code43
Code44 = UCase(Mid(txtCMD, 87, 2))
Hex44 = Code44
Code45 = UCase(Mid(txtCMD, 89, 2))
Hex45 = Code45
Code46 = UCase(Mid(txtCMD, 91, 2))
Hex46 = Code46
Code47 = UCase(Mid(txtCMD, 93, 2))
Hex47 = Code47
Code48 = UCase(Mid(txtCMD, 95, 2))
Hex48 = Code48
Code49 = UCase(Mid(txtCMD, 97, 2))
Hex49 = Code49
End Sub
|
|
|
|
|
you could cut down with the string , also you could make an array of your textboxes , then you could use something like this :
Vb6:
<font color="blue">Private</font> <font color="blue">Sub</font> Command1_Click() <br> <font color="blue">Dim</font> code(2 To 49) <font color="blue">As</font> <font color="blue">String</font>, x <font color="blue">As</font> <font color="blue">Long</font> <br> <font color="blue">Dim</font> txthx(2 To 49) <font color="blue">As</font> <font color="blue">String</font> <br> <font color="blue">Dim</font> tb <font color="blue">As</font> TextBox <br> <br> <font color="blue">For</font> x = 2 <font color="#0000FF">To</font> 49 <br> <font color="blue">For</font> <font color="blue">Each</font> tb <font color="blue">In</font> <font color="#0000FF">Controls </font><br> <font color="#0000FF">If</font> tb.Name = txthx(x) <font color="#0000FF">Then </font><br> tb.Text = code(x) <br> <font color="blue">End</font> <font color="#0000FF">If </font><br> <font color="blue">Next</font> <br> <font color="blue">Next</font> <br> <br> <font color="blue">End</font> <font color="blue">Sub</font> <br>
that would cut out a lot of code
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
That looks like it would save a lot of code, but I'm not sure how to use it to get the results I need. Am I correct that this is attached to a command button?
|
|
|
|
|
I can't believe I haven't been able to find any way to clear the console
screen in vb.net.
All I want is to clear the console screen just like issuing a cls command
at a command prompt.
Does anyone out there know how this is done?
|
|
|
|
|
You could try P/Invoke'ing the FillConsoleOutputCharacter function. See MSDN Library for details.
|
|
|
|
|
Thank you!
I found it in the MSDN libraries url is http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b319239
if anyone is interested. A WHOLE lot of work just to clear the console,
I can't believe they didn't include this functionality in the Console
namespace.
Oh well, maybe next time. Thanks again!
|
|
|
|
|
If it's any consolation (no pun intended), there's no function for this that I can see in the C runtime library either - I was going to look at the implementation if there was one.
In case anyone else wants that article, clickety[^].
|
|
|
|
|
|
I have two datatables which are populating from two different tables of two different databases. I want to get all the records of first datatable which are not in 2nd datatable. I ‘m using the following piece of code.
odr = oDs.Tables(0).Select("Sno = (SELECT SNO FROM " + Convert.ToString(oDataSetChanges.Tables(0)) + ")")
or this one
odr = oDs.Tables(0).Select("Sno NOT IN (SELECT " + Convert.ToString(oDataSetChanges.Tables(0).Columns("SNO")) + " FROM " + Convert.ToString(oDataSetChanges.Tables(0)) + ")")
or I tried the following code as well
oDv1.RowFilter = "Sno NOT IN (SELECT SNO FROM " + Convert.ToString(oDv2.Table) + ")"
where SNO are the primary key columns of both tables but by using all these code I got the same syntax error that is
Message "Syntax error: Missing operand after 'SNO' operator."
Kindly help me in this reagard ASAP
Thanx in advance
|
|
|
|
|
I don't think this is possible. The Select() method doesn't have the full power of SQL - it can only define fairly simple filter expressions.
You can set up relations between tables in a DataSet with the Relations property to set up a parent/child table relationship; however, I don't think you'll be able to do this in this case - I don't think it'll help.
I'd recommend - assuming that your data is coming from at least one SQL Server - setting up a link between the two servers (so that server A can see the table on server B) and performing the difference operation in a stored procedure. You can then use the full power of SQL.
--
Mike Dimmick
|
|
|
|
|
hi mike
thanx for ur reply. i used ur opinion i.e linked both the sql servers via enterprise manager now tell me plz how much it will take effect on the execution performance with respect to time than that of disconnected datasets.
regards
Aamir
|
|
|
|
|
SQL Server uses OLE DB internally to access and manipulate tables of data. It's optimised for manipulating data sets.
As long as the connection between the two servers is at least as fast as the connection between the client and the two servers, you shouldn't see any difference.
Indeed it might even be quicker than two datasets, because SQL Server will tend to fetch rows from the linked database and its local database asynchronously, whereas you typically fill your local datasets synchronously, waiting for the first to complete before asking for the second. (I believe you could do this yourself by using BeginInvoke to perform both operations on the thread pool, then wait for both IAsyncResult.AsyncWaitHandle s to be signalled).
Your experience may vary and, as always with performance, you should measure it rather than guessing. Query Analyzer can show you the query execution plan and the time taken to execute the query.
If the link between the servers is slow (perhaps they're located far apart, geographically?) you could consider replication instead.
|
|
|
|
|