|
Hey It Seems to be ok but the part that says drNew = drGrid.NewRow it says NewRow is not declared. am I supposed to replace this with something.
|
|
|
|
|
hello
i have build a database using MS ACCESS and write a coding in VB.NET to connect it as below
Imports System.Data.OleDb<br />
<br />
Public Class addItem<br />
Inherits System.Windows.Forms.Form<br />
Dim myconnection As New OleDbConnection("provider=microsoft.jet.oledb.4.0; datasource = Application.ExecutablePath + \LibrarySystem.mdb")<br />
<br />
Private Sub saveB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles saveB.Click<br />
myconnection.Open()<br />
Dim mycom As New OleDbCommand("INSERT INTO Product(product_code) VALUES ('" & productTb.Text & "')", myconnection)<br />
Dim MyReader As OleDbDataReader = mycom.ExecuteReader()<br />
mycom.ExecuteNonQuery()<br />
myconnection.Close()<br />
MyReader.Close()<br />
mycom.Dispose()<br />
End Sub
but when i click on the saveB button, the error below show up
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
which point to
myconnection.Open()
may i know what i did wrong?
thank you in advance
Gary
|
|
|
|
|
GaryKoh wrote:
Dim myconnection As New OleDbConnection("provider=microsoft.jet.oledb.4.0; datasource = Application.ExecutablePath + \LibrarySystem.mdb")
This is your connection string. So it actually evaluates the variable you put in it, shouldn't it look more like this:
Dim myconnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.ExecutablePath & "\LibrarySystem.mdb")
Better yet, assemble the path name to the database using the proper function:
Dim dbPath As String = Path.Combine(Application.ExecutablePath, "LibrarySystem.mdb")
Then use this to open you database:
Dim myconnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi i have a list of data in a listview.
how do i set specifice item to have Imageicon, certain item don't
I'm using VB.net
|
|
|
|
|
Is it possible work with ADO and MySql Database in VB6?
|
|
|
|
|
Check here[^] for an example using VB and the MySQL ODBC 3.51 Driver using ADO. You'll need the driver, in addition to MySQL - it's available from this site[^].
"If it's Snowbird season, why can't we shoot them?" - Overheard in a bar in Bullhead City
|
|
|
|
|
hi i would like to write a code that let me drag files from a specified folder automatically on a richtextbox not manually, i want to drag all file types on this richtextbox thanks for any help i need code of u can plz
Thanks alot
Metal Man
|
|
|
|
|
I am looking for tourtials to add password/key protection to a source to keep it as safe as possible. Thank You
|
|
|
|
|
Add to a source? Source of what?
Keep what as safe as possible? If you're talking about files, trying checking into the security features of NTFS.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How would i set a url in an images property? so the image can be automatically downloaded into a program
|
|
|
|
|
Here you go:
Dim webRequest As System.Net.WebRequest = System.Net.WebRequest.Create("http://www.microsoft.com/h/en-us/r/ms_masthead_ltr.gif")
Dim webResponse As System.Net.WebResponse = webRequest.GetResponse
PictureBox3.Image = Image.FromStream(webResponse.GetResponseStream)
Hope this helps.
Tom
|
|
|
|
|
|
I have several date fields in a database I am displaying. Some of the fields do not have a date value yet (they are set to null), but I would like to use the datepicker to put data into them. The problem is that fields that don't have a date in them from the database are filled in with the current date. If the user saves the record the current date will be saved to all the fields that should be blank (null).
Is there a way to display (or not to display) the datepicker field without a date in it?
|
|
|
|
|
How to invoke mouse hover event on task bar menues indiviual buttons. Please if some one help me,answer my question as soon as possible iwll be thank ful to u.. thanks in advance.....
☺«««DTA»»»☺
|
|
|
|
|
How can I compare 2 images using Visual Basic.
I want to compare a image with its master image and see if it has a spot at certain position
Jack
|
|
|
|
|
I use vb6. I want to read bmp's pixel. For example 1st pixel, 2nd pixel or coordinate system (1,1), (5,12).
I examinated a few example about change bmp's . I modified them. I didn't read pixel right.
1st pixel black and 2nd px white > I use "for ... next" read value 1.0 2.0 3.255 4.233
|
|
|
|
|
I'm trying to make a video game on visual basic. it has to have a christmas theme and incorporate random numbers. does anybody have any ideas or tips that i could use???? thanks
|
|
|
|
|
Hi guys, I need help on widows clipboard. My app (VB.net) run in the systray, and it registers some global hotkeys like "Alt + Num1", I need that this hotkey be as the "Ctrl + c" hotkey, so when I press Alt+Num1, set the clipboard with the selected text of the active window.
Thank you in advance
Damian
|
|
|
|
|
Hi,
I am re-writing an application that used access as the backend.
I am using t-sql.
I have a query with this line, and I would just like to know the best way to convert it to sql.
CCur(Format(DSum("[Amount]","Line_Item_Payments","ChargeID=" & [Charges].[ID] & " AND Type =" & 4),"#,##0.00;;;0.00")) AS PC
Basically it looks in Line_Item_Payments for every charge in Charges and totals it by type.
I have been working with this query for a bit and have been unable to have workable results come from it.
Please help,
-Edward
|
|
|
|
|
Hi...
i confuse how to make my data grid keep up to date...
couse when i update my data from SQL, my datagrid is still old data...
for example if i add my data....
thx for helping....
:::Widhie:::
|
|
|
|
|
I have created a project of approx. 4400 lines of code (I used the project line counter to check it )
It looks great, but it is slow when I first click on a button in my program, to logon a user on a computer. (I created a cyber cafe management program)
I also created a sample of this project in C# and it seems faster there.
Is it possible that VB.NET delivers slower code than C#?
I know it's not possible in theory since it's all IL, but still...
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
Hi again,
When I stick the AxMsFlexgrid1 on to my form and when I run it, It just displays the form witout the datas in it,
If I remove it then all the datas appear on the form.
Like I am populating my combobox1 from the data set.
When I have the flex grid on my form the combox comes up empty.
But if I remove the Flex grid the combobox is populated from the data set.
What am I missing?
Tnx
|
|
|
|
|
Hi all,
Can some one help me as to why I am getting this error mssg?
@ da.SelectCommand.CommandText = "select orig,ordno,name,chkno,blno,state,adr1,orddt,txble,txcrt from cshhdrpf where orig = " & arr(1) & "and ordno = " & arr(2)
Error Mssg:
Additional Information: Index was outside the bounds of the array.
Dim arr As array
arr = Split(cmb1.Text, " - ")
Dim da As New OleDbDataAdapter()
Dim ds As New Data.DataTable()
da.SelectCommand = New OleDbCommand()
da.SelectCommand.Connection = conn
da.SelectCommand.CommandText = "select * from Test1 where orig = " & arr(1) & "and ordno = " & arr(2)
da.SelectCommand.CommandType = CommandType.Text
Tnx
|
|
|
|
|
Just like the error message says... The index 1 or 2 doesn't exist in your arr array.
You're either not splitting your cmb1.Text text with the correct splitter or you're not getting the result you expect. Try stepping through the code and see what arr = Split(cmb1.Text, " - ") is actually returning.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I want to learn VB, but do not have access to Visual Basic, nor the funds to get hold of the s/w. I would be grateful if anyone could suggest a free software similar to the M$ version.
Downloading is not a problem. Hope to listen from you soon.
Regards,
Ajit
"Insanity is my Birth Right!!!!"
|
|
|
|