|
This isn't even a feature in the .NET Framework. Your comparing the USB port to a Serial or Parallel port. This is simply not how this port works.
USB communication is done through the device drivers for the device you're trying to communicate with. If that device exposes a simulated "serial" port, then you can use that to talk to it. If not, you'll have to consult some kind of SDK for the device in question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello to anyone
i have a big problem about entering txt into another form which has a datagrid but i'm using another form which i get the data that can populate the datagrid in that form which has a datagrid...now i want to know that if i going to add new record in the other form to put into the other form which has the datagrid...if i click the new button it well supposed to display a black record from the datagrid so that i can also add record again ...here's my
code.....
//
Public Sub addrecord1()
Try
Dim x As Integer
Dim myconnection As New SqlConnection("Data Source=SDG_06;Initial Catalog=sample;User ID=sa;Password=sa")
Dim cmd As New SqlCommand("usp_datainsert", myconnection)
cmd.CommandType = CommandType.StoredProcedure
For x = 1 To 13
cmd.Parameters.Clear()
cmd.Parameters.Add("@name_of_the_school", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 1).ToString = tnameschool.Text 'datagridview1.Item(x, 1).ToString ='
cmd.Parameters.Add("@address", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 2).ToString = taddresschool.Text
cmd.Parameters.Add("@degree", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 3).ToString = cbodegree.Text
cmd.Parameters.Add("@from1", SqlDbType.Char, 10, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 4).ToString = tfrom.Text
cmd.Parameters.Add("@to1", SqlDbType.Char, 10, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 5).ToString = tto.Text
cmd.Parameters.Add("@please_specify", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 6) = cbograd.Text
cmd.Parameters.Add("@major_in", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Form2.DataGrid6.Item(x, 7).ToString = tmajor.Text
Form2.DataGrid6.Update()
myconnection.Open()
cmd.ExecuteNonQuery()
Next x
Catch ex As Exception
MessageBox.Show(ex.Message, "Error dito sa Addrecord1", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
End Try
///
how i'm going to renew my code
|
|
|
|
|
My application runs long and complex convertion, so i want to make it possible for the end-user to cancel this. However, as you may know, just placing a button does not help since any Visual Basic application is not able to let you use form elements while it is working.
How can i let the user cancel the process comfortably at any time?
|
|
|
|
|
Try this sample
Public Class Form1
Private bCancel as boolean
Private Sub DoLooping
While Not bCancel
Application.DoEvents()
'Do Something
End While
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bCancel = True
End Sub
' You can also use thread.
End Class
!alien!
|
|
|
|
|
Cheesy poor man approach - use a timer or application.doevents to let the cancel button be clicked.
Better approach - do long-running processing on a background thread. Rocky Lhotka's article (link below) provides a straightforward approach for controlling a task and providing for user cancellation. You can have it implemented in 2 hours.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet09272002.asp
Patgrape
|
|
|
|
|
I create shared add-in project in VS2003.
In the wizard, I have just tick the WORD for my test,
How can I change this project for WORD, Excel and Outlook now?
Thank you!
|
|
|
|
|
cant send focus to another control from my usercontrol
tried many thing
keypreview = true
processdialoguekey
overrides...
pls help
tnx in advance
|
|
|
|
|
Try this code
'Me is UserControl
Me.FindForm.SelectNextControl(Me, True, True, True, True)
May u be ok?
!alien!
|
|
|
|
|
|
without ActiveSync ...how to convert it??
|
|
|
|
|
Could not find stored procedure 'DBAuthenticate'.
--> cmdSelect.ExecuteNonQuery()
|
|
|
|
|
It's telling you that your database doesn't have a stored procedure called "DBAuthenticate". Either you got the SP name wrong in your code, or you're not connected to the database you think you are when this call was made.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i got the DBAuthenticate function but still the same error appears.how can i made the connection?or test the connection is there?
|
|
|
|
|
If you get this error, your connection is being made successfully. There are still the problems that I mentioned, plus the possibility that your code is either using an SQL account or running under a Windows account that does not have the permissions to execute that stored procedure.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Compiler Error Message: BC30516: Overload resolution failed because no accessible 'New' accepts this number of arguments.
objTicket = New FormsAuthenticationTicket(2, textUsername.Text, DateTime.Now.AddMinutes(30), False, dtrRoles)
i added the new sintaks as u told but this come up.
|
|
|
|
|
I think it's pretty obvious what the error means. You trying to create an object who's constructor, according the documentation, takes 3, 6, or 7 arguments. You've supplied 5 in your code. These[^] are the possibilities.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I am developing a GUI prototype in the VB which comes with Visual Studio 2005. I am new with VB, so I believe it's a newbie question. Everything goes fine until I press "Rebuild All". When I press it, VB drops all my settings of anchors, docking etc. and centers everything. As a result, the main menu, toolbars, status bars all get centered instead of where I chose to dock them. I also tried to select "lock = true" hoping it will stop this behavior, but it does not help. There must be some way to keep the selected alignment properties, but how? Would appreciate any help. Thank you!
Nick Kisialiou
|
|
|
|
|
The question should be what's causing it to center everything. This is most definately NOT normal behavior.
Does it do this if you create a new project and then just put couple of buttons on the form?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It works fine with a new project. I must have screwed up somewhere, I will look for the source of this abnormality. Thanks!
|
|
|
|
|
Did you use any custom controls or non-standard controls not normally supplied by the ToolBox?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No, everything comes from the toolbox. Although this new toolbox in VS2005 is larger than that in VS.NET and offers some new properties. I have used lots of Table Layout Panels and Split Containers, also I use my own graphical resources, jpg files created in photoshop for backgrounds. I have also noticed that at some point VB became very slow while I was modifying the UI, it may be because of graphics though, need to check on it.
|
|
|
|
|
RainbowWyrm wrote: I have used lots of Table Layout Panels and Split Containers
Define "lots"... All on one form?? Is there a form with "lots" of controls on it?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The main dialog form represents the main window and so far contains (this is the back bone without small components which I have not placed yet):
1) 1 Main menu,
2) 2 Main toolbars and 1 toolbar in a child window,
3) 5 Table Layout Panels - to position child windows properly, to separate labels from toolbars from work area windows,
4) 2 Split Containers,
5) 1 Status bar,
6) 3 Tab controls (1-3 tabs in each),
7) 1 Tree View.
I don't think it is "lots", at least I would assume that VB should be able to handle it. Maybe it is the inserted images that cause such behavior?
|
|
|
|
|
The .NET Framework can handle this number of controls easily. The question becomes is the layout being setup correctly in your code? What the designer lays out when you drop the controls in place, visually might look OK, but in fact, your control is actually not in the container that you dropped it on. You might want to go through your designer generated code and follow it step-by-step to see which containers your controls are actually ending up in.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I want use my flash animation/.swf file in my vb.net program. How can it possible, pls. guide me.
thanks a lot
-- modified at 15:40 Sunday 12th February, 2006
|
|
|
|
|