|
I'm a beginner in Vb.net 2003 version. There is a certain form i ahve that does not add records to the back end access database. Instead the system stops running and highlights in green the following line of code 'cmd.ExecuteNonQuery()'
What could be the problem with this specific file?
muraguri
|
|
|
|
|
muraguri wrote: Instead the system stops running and highlights in green the following line of code 'cmd.ExecuteNonQuery()'
What could be the problem with this specific file?
You have to tell us what the command is. A code sample would be good.
We also need to know what the error message (the exception message) is also.
|
|
|
|
|
The code is as follows:
cmdSave.Enabled = True
strsql = "INSERT INTO Worksheet(WorksheetNo,DriverName,CustomerName,VehicleRegistration,PickUpPoint,Destination,StartTime,EndTime,Transaction,Smileage,Emileage,Distance,Rate,TotalCharge,VoucherNo,Condition,Cleared)" & _
"VALUES ('" & txtJDNo.Text & "','" & cboDriver.Text & "','" & cboCustomer.Text & "','" & cboVehicle.Text & "','" & txtPick.Text & "','" & txtDestination.Text & "','" & txtStart.Text & "','" & txtEnd.Text & "','" & cboTransaction.Text & "','" & txtDistance.Text & "','" & txtRate.Text & "','" & txtCharge.Text & "','" & txtVNo.Text & "','" & txtCondition.Text & "')"
oledbcon.Open()
Dim cmd As New OleDbCommand(strsql, oledbcon)
cmd.ExecuteNonQuery()
oledbcon.Close()
The error i get is 'An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll'
Muraguri
|
|
|
|
|
Wow! SQL Injection Attack City!
First, you are not sanitising your input. Second the unsanitised input is being injected directly into the SQL string. You should look into using parameters because it is more secure and can reduce errors by increasing the readability of the SQL.
Here is an article on SQL Injection Attacks and tips on how to prevent them[^]. This will help you form better queries.
muraguri wrote: The error i get is 'An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll'
And the exception message? (This is just the type of exception)
|
|
|
|
|
how i setup my resolution in vb.net code,by help which event i do this,i want to resize my dialogbase and all the controls present in the dialogbase are change there size when i change the resolution according to that resolution all the thing change automatically.
Ram Krishna Pattnayak
Software Developer(SDS)
Sun-Dew Solutions Pvt.Ltd
www.sundewsolutions.com
kolkata
|
|
|
|
|
If you set the Anchor property correctly on your controls, they will resize when your form resizes. The Dock property is less useful, and you can only use one or the other.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for giving hints,but it not work all the control are move and when i use some GUI based operation like put some Sheming effect (put BMP in all Controll )all the controll BMP stretched and they change their shape .when i change resolution.
Ram Krishna Pattnayak
Software Developer(SDS)
Sun-Dew Solutions Pvt.Ltd
www.sundewsolutions.com
kolkata
|
|
|
|
|
Hi,
this error is related to pure vb application having some activeX and COM components in it.
After writing the vb application, I have created its exe. But when i start the exe i am getting an error msg as:
Runtime error '-2147417848 (80010108)'
Automation error
The object invoked has disconnected from its clients.
Could anyone tell me y this error has occured??
thnx,priya.
|
|
|
|
|
Hello,
i'm searching for a possible way to draw smoother lines in gdi. A black line for example should be black only in the middle and getting more and more transparent when reaching it's boundaries. The antialiasing ("smoothing mode") is doing the right thing, but too less. The may have also curves (-> many short lines connected), so working with gradient rectangles is not possible.
It should not need much more ressources, so putting several lines with decreasing width one-over-another is also not good, i think. Isn't it possible to set a gradient alpha to the pen tip or setting a specific blur for all lines?
thank you, dartrax
www.dartrax.de
|
|
|
|
|
|
hi
i am using an IDE Predifined connectionstring. and the only reason i actually questioning it now is because i can't work out how to close a connection this way. i understand there is a way to code it in. if someone can assist me with working out how to close my IDE defined connectionstring then i wont worry about another option unless its my only way.
Thanks
Robbo
|
|
|
|
|
hi,
my Problem is, that i need some Sourcecode to Hide my IP and other Informationens that are provided from my PC to the Internet. For example there are lots of websites which can show my Internet IP Adress, Operating System, referer, language and so on.
How can i broadcast customized information to stay anonmyos!
I need some Sourcecode to change my Internet IP-Address to a public Proxy-Address that i choosed.
So how does Programs like "Hide my IP" and so on Work!!
THX
|
|
|
|
|
If there is a program that does this, it provides you with a dummy IP, and acts as a proxy. There is no way to browse the web without an IP address.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes , i know this, but how can i program such a Application! I need some Sourcecode or some importent advise, how to do this!
|
|
|
|
|
Hi all,
I've added a vertical scrollbar to a richtextbox, however cant get it to work, (so that if you add alot of text you can use the scroll bar to scroll through what you've added).
Im sure it's something quiet simple that im not doing.
Thanks in advance
Jaidev
|
|
|
|
|
What the heck am I missing. My datagridview doesn't get the data from the data table??
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
Dim DataTable1 As New DataTable
DataTable1.Columns.Add("A")
DataTable1.Columns.Add("B")
DataTable1.Columns.Add("C")
For i As Integer = 1 To 4
DataTable1.Rows.Add("1, 2, 3")
Next
Console.Write(DataTable1.Rows.Count & vbCrLf)
Dim DataGrid1 As New DataGridView
DataGrid1.DataSource = DataTable1
DataGrid1.Refresh()
DataGrid1.Update()
Console.Write(DataGrid1.Rows.Count)
End Sub
|
|
|
|
|
Sorry, the problem is that the datatable has 4 rows, whereas the grid has zero rows???
Changing refresh() and update() doesn't seem to matter
|
|
|
|
|
Hello,
I have a small problem...
I try to add the functionality of binding to a ToolStripProgressBar but i can't..
However it goes perfectly with all other ToolStripItem(ToolStripLabel, ToolStripButton. ToolStripSplitButton, ToolStripSeparator, etc...)
When I overload them they appear in the list of the elements available and I can use them but with ToolStripProgressBar impossible to reach that point.
Here is the code which enables me to overload the element.
Public Class BindableToolStripProgressBar
Inherits ToolStripProgressBar
Implements IBindableComponent
#Region "IBindableComponent Members"
Private _bindingContext As BindingContext
Private _dataBindings As ControlBindingsCollection
Public Property BindingContext() As System.Windows.Forms.BindingContext Implements System.Windows.Forms.IBindableComponent.BindingContext
Get
If _bindingContext Is Nothing Then
_bindingContext = New BindingContext
End If
Return _bindingContext
End Get
Set(ByVal value As System.Windows.Forms.BindingContext)
_bindingContext = value
End Set
End Property
Public ReadOnly Property DataBindings() As System.Windows.Forms.ControlBindingsCollection Implements System.Windows.Forms.IBindableComponent.DataBindings
Get
If _dataBindings Is Nothing Then
_dataBindings = New ControlBindingsCollection(Me)
End If
Return _dataBindings
End Get
End Property
#End Region
End Class
|
|
|
|
|
I found a solution…
In fact it is necessary to pass by the property ProgressBar from ToolstripProgressBar which it allows Binding.
ToolstripProgressBar.ProgressBar.DataBindings.Add(.......)
and there it goes perfectly....
|
|
|
|
|
|
Do you mean tiering?
Cleako
|
|
|
|
|
No not tiering!
I would like to design/implement a custom control in C Sharp or Visual Basic Dot Net. For this reason i ask a question that how i implement a layer in vb like in Photoshop or Coral Draw or any other graphic program.
-- hope you help me --
thank you for your kind reply!
== adil ==
|
|
|
|
|
I dont think I can help you with this but you should try reposting this with a clearer question and I bet you'll hear something.
CleAkO
|
|
|
|
|
Hi,
I'm trying to add SQL Native Client to my setup project as a prerequisite. I've done this before with the Reporting Services Viewer. But I can't get it to work with the SQL Native Client
I've downloaded the redistributable: sqlncli.msi
Can anyone help?
Thanks
|
|
|
|
|
Hi,I am facing a problrm.
If anyone can say, how to get an elements font color from webbrowser.The color is maintained by css.
Sandy
|
|
|
|