|
I am guessing you need to provide the adapter with an insert statement ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Here I used ACE.OLEDB.12.0. for office 2007-Access [accdb] But I want you to use Jet.Oledb for office 2003-Access [mdb]
Dim Ithuva As String = "Samples To Aman"
con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Temp\sample1.accdb;Persist Security Info=False")
con.Open()
Dim CmdTxt As String = "Insert into address (city) values ('" & Ithuva & "')"
Dim cmd As OleDbCommand = New OleDbCommand(CmdTxt, con)
cmd.ExecuteNonQuery()
con.Close()
|
|
|
|
|
Do you have any primary keys defined for the underlying table?
If you don't OleDbCommandBuilder will not work.
|
|
|
|
|
I am trying to find a program in Visual Basic that will list all open windows on a computer. I am trying to activate a window based on it's title bar. I've looked up EnumWindows and GetWindow for examples but I am running into problems with the code I find (it doesn't work). I'd like to find some code that does. I have a intranet website that shows customer info and i'd like to activate a window based on the number they called. I want to call this program with a variable that will bring a window to the forefront based on that variable. Any help you provide would be most appreciated.
Thanks for all the help
NewbieDave
|
|
|
|
|
I don't know that you can enumerate windows on a client, from the server.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You cannot enumerate windows on a client machine from a web server.
|
|
|
|
|
I did note he was saying it was on an intranet, that's why I assumed he may not be totally insane. But, even then, I'm pretty sure he can't do it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
We just installed the Cisco Unified communications system and we can have a web display that shows customer info based on thier phone number. I'd like the end user to have a dual monitor setup so that the customer info shows up on one screen (web display) and on the other would be a windows program for entering info about the customer. So it sounds like I'd have to have my program resident on the users computer, pass the program the customer info then populate the web display from the program while it also enumerates the correct program. Does that sound possible?
Thanks for all the help
NewbieDave
|
|
|
|
|
It sounds like you want to not use the web at all, and just write a program that runs over the internet.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi all,
I have a datagridview on a form. I have a subroutine called LoadReloadProcs that has this line in it
Me.dgvProcs.Columns(0).Width = Me.dgvProcs.Width * 0.75
This is the line where the error's happening. I'm getting an objectdisposed error.
Funny thing is, it'll run through this routine twice without reporting an error. It only reports the error when I come back from running a report. Also, if I put a breakpoint right there and use the immediate window to check the value of the width (i.e., ? dgvProcs.Columns(0).Width) the system tells me that it is 100. But if I try to assign a value to the width (i.e., in the immediate window dgvProcs.Columns(0).Width = 435) the system throws the object disposed error.
Why would I be able to request information of an object that is disposed? I shouldn't be able to, right? Or if it is not disposed, which being able to query the value of something suggests, why can't I assign a value to that property?
This has me really confused.
I've put the code for the procedure below... I don't see anything in there that helps me understand, but I figured one of y'all might. Also, I've searched for "dgvProcs.dispose" and just for ".dispose" and didn't find any relevant to dgvProcs.
Private Sub LoadReloadProcList(ByVal strsql As String)
Try
'Me.Controls.Remove(dgvProcs)
Dim daMyList = New SqlCeDataAdapter(strsql, myDB.cn)
Dim dsMyList = New DataSet
daMyList.Fill(dsMyList)
Dim myBinding As New BindingSource
myBinding.DataSource = dsMyList
Me.dgvProcs.DataSource = myBinding
Me.dgvProcs.DataMember = "Table"
Me.dgvProcs.Columns(0).HeaderText = "Name"
Me.dgvProcs.Columns(0).Width = Me.dgvProcs.Width * 0.75
Me.dgvProcs.Columns(1).HeaderText = "Barcode"
Me.dgvProcs.Columns(1).Width = Me.dgvProcs.Width * 0.15
Me.Controls.Add(dgvProcs)
Catch ex As Exception
#If DEBUG Then
MsgBox(ex.Message)
#Else
MsgBox("There was a problem gathering information on your previous procedures. If this problem persists please contact your distributor.")
#End If
End Try
End Sub
Thanks in advance for any help you can give.
Denise "Hypermommy" Duggan
|
|
|
|
|
You have a DataGridView on your form that YOU called dgvProcs . So, obviously searching the Internet for a name that you made up is going to be pointless.
The error message says that you destroyed the dgvProcs object and now you're trying to use it. The line that you commented out in your code snippet would do that if it wasn't commented out before. Me.Controls.Remove(dgvProcs) would detroy the dgvProcs object.
|
|
|
|
|
I'm not so confused that I searched the internet for dgvProcs. I searched the code. Sorry I didn't make that clearer... I guess I just figured it was obvious.
And yes, if that line weren't commented out I can see that it would do it. But that line's been commented out the whole time and I'm still getting the error. It's really wierd.
Denise "Hypermommy" Duggan
|
|
|
|
|
No, there could be no more references holding on to it.
The other thing, that i didn't see earlier, is possibly the columns being wiped out and rebuilt after the data bind.
And, of course, the possibility of having to Clean the project, then rebuild.
|
|
|
|
|
Clean the project and rebuild? I'm afraid I don't understand. There's still a lot of tools in Visual Studio that I'm learning... is "clean" one of them?
I do appreciate the assistance, believe me!
I ended up finding a workaround... I noticed that if I clicked OK on the messagebox that informed me of the error, the system went on ahead and built everything and all looked and acted okay. So what I did was just put a separate catch block in there to catch just the object disposed exception and swallow it up and ignore it. That done, everything appears to work fine. Of course, the "solution" makes me a bit nervous as ignoring exceptions is probably not the safest thing to do.....
But maybe it gives a clue to one of you gurus that says what's going on... 'cause this is still too weird to me.
Denise "Hypermommy" Duggan
|
|
|
|
|
Hi Dave,
Dave Kreskowiak wrote: Me.Controls.Remove(dgvProcs) would detroy the dgvProcs object
I'm not with you here. Who would be doing the Dispose?
Are you saying ControlCollection.Remove(x) actively calls x.Dispose()?
(I can't see that in the doc)
or x being removed becomes collectible? from the code dgvProcs is a class member, so this reference is still alive.
Couldn't the problem be that by setting a new DataSource the Columns[] collection got lost?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hello everyone,
I have a UserControl, I inserted inside a MenuStrip and a Panel.
This UserControl must be a Panel, when do I upload controls, inserted controls, must be entered panel I inserted in the usercontrol.
Sorry for my poor English, I hope my problem is clear.
Thank you
|
|
|
|
|
eusta wrote: I hope my problem is clear.
Not in the slightest. I have no idea what you're trying to say.
|
|
|
|
|
|
No, it's not... I still have no idea what your on about.
|
|
|
|
|
Hi,
I am new to VB.Net and i am working on School Management project in VB.Net windows application. In that i need to insert the Images of the Students. So i am trying using BLOB Datatype in MySQL, but i am unable to store the image and also the saved image should be retrieved.
So, Please if any one knows the solution of my problem help me and do me the favour.
Thanks in advance,
Victoria
VB.Net
|
|
|
|
|
|
An alternative solution (one that we use in our internet store for product images) would be to save the images, with the student's ID as the name, to the (web?)server.
In your code you can then simply retrieve the necessary image based on the ID.
That way the database size doesn't become an issue, and no need for interpreting, converting or whatever.
Our experience is that searching the file is on average faster than searching from the database.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi Johan,
Thanks for your Reply,
I am working on a Desktop application that means windows application, but you are telling in Web application it seems.
I am sorry if i was wrong with your answer because i am new to .Net, So i am in the beginning stage only.
If you dont mind, can u give me the detailed solution for this.
Thanks in advance,
Victoria
VB.Net
|
|
|
|
|
I thought you were working with a web application because of the MySQL database (which is usually used for web sites).
For the solution I suggested it doesn't matter though, the principle is pretty much the same.
I assume that you want the show the students' pictures when browsing through the student list.
So basically you follow these steps:
1. Each student has a unique ID: save each student's picture as [StudentID].jpg, in a folder that your application can access (for example a shared folder on the same server the database is on.)
2. On the form that shows the student's information, I assume you have a picture box, that should show the student's picture. Use Imports System.Drawing.Imaging and PictureBox1.Image = New Bitmap(Image.FromFile("ThePathToTheSharedFolderHere" & StudentID & ".jpg")) (or something similar, you may have to play around with it a little).
My advice is free, and you may get what you paid for.
|
|
|
|
|
I have Datecs electronic cash register model MP-55B who is connect to PC from COM port but I have not driver for this device, can You help me to write driver for this device
|
|
|
|