|
First, you declared your reader variable incorrectly. It should read:
Dim conStr1 As String
Dim con1 As SqlConnection
Dim reader As SqlDataReader
Dim sql1 As String
Dim command As SqlCommand
The second thing to check is if your SELECT statement is actually returning any rows. Are you sure this is a good query?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah,thank you so much Mr.Dave Kreskowiak,I solve my problem. Beside the two things you found,I should convert the integer to string as the satabase structure. Thank you so much for helping me.
Regards
Drexler
|
|
|
|
|
Hi guys,
I m a newbie to data report.But i manage to do a report using data report & data environment.I also i manage to output that record to html file.But when i view the record in html format.it shows all the record but i want to print only one record from the database.Do i need to write query for that if so please guide me how to do that step by step..... Thanks in advance
Help me ASAP.....
|
|
|
|
|
I am trying to write a program using the usb port on a computer to interface with another processor to collect data. I took a look at the ms comm in vb6 and all I see are the standard serial and parallel ports. Am I missing something or it not a feature of VB6
Scott
|
|
|
|
|
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.
|
|
|
|