|
I created a Student.XLSX file with the 3 columns as you stated in your OP.
The code below successfully ran and imported the data to a dataset which was then bound to a DataGridView;
Dim conBuilder As New OleDbConnectionStringBuilder
conBuilder.Provider = "Microsoft.Jet.OLEDB.4.0"
conBuilder.DataSource = "C:\Users\Dave Auld\Desktop\Student.xlsx"
conBuilder.PersistSecurityInfo = False
conBuilder.Add("Extended Properties", "Excel 8.0;HDR=YES;")
Dim con As New OleDbConnection
con.ConnectionString = conBuilder.ConnectionString
Dim com As New OleDbCommand("Select * from [Sheet1$]")
com.Connection = con
Dim da As New OleDbDataAdapter(com)
Dim ds As New DataSet
Dim rowcount As Integer = da.Fill(ds)
DataGridView1.DataSource = ds
DataGridView1.DataMember = ds.Tables(0).TableName
|
|
|
|
|
Hi,
I have copied the data in a new dataset "ds1". Please tell me how to copy this "ds1" contents into Access Database. I am trying with following:
Dim da2 As New OleDbDataAdapter
Dim conn As OleDbConnection
Dim cmd As OleDbCommand = New OleDbCommand()
conn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\alldata.mdb;")
cmd = New OleDbCommand("SELECT * FROM Denver", con)
da2 = New OleDbDataAdapter(cmd)
da1.Fill(ds1, "Denver")
But not able to populate the Access database.
Can You guide me how to do this??
Thanks,
R.S.
|
|
|
|
|
|
You have to account for the fact that no two scans of the exact same card will result in a pixel-by-pixel equality. Every pixel is going to be a slightly different color than the same pixel in the previous scan.
If all you're doing is OCR'ing the business cards, why even bother comparing two images of the cards and just compare the data that's coming off them?
If you have to compare the images, then you'll have to implement a filter (in C#, not VB.NET!) to process the image to equalize the colors. For example, if you look at the white part of a business card, you'll see a scattering of pixels of different colors, not an even white acrossed all of them. You have to implement a filter to remove all those color variations to generate the nice flat color acrossed all pixels.
Search the articles for "image processing for dummies" and you'll find some good examples by Christian Graus.
Ph, you can't do this in VB.NET. If you wanted any speed at all, it has to be done in C#, or some other managed language that supports pointers. VB.NET doesn't.
|
|
|
|
|
dear dave... all you wroted isnt corect! download the archive which i posted and try to compare two images...
|
|
|
|
|
Dave Kreskowiak wrote: You have to account for the fact that no two scans of the exact same card will result in a pixel-by-pixel equality. Every pixel is going to be a slightly different color than the same pixel in the previous scan.
i know that and understand what you mean so i made:
Private Function CheckPixel(ByVal source_color As Color, ByVal search_color As Color, ByVal tolerancy As Integer) As Boolean
Dim sense As Long
sense = 255 - tolerancy * 5
CheckPixel = (System.Math.Sqrt((Val(source_color.R.ToString) - Val(search_color.R.ToString)) * (Val(source_color.R.ToString) - Val(search_color.R.ToString)) + (Val(source_color.G.ToString) - Val(search_color.G.ToString)) * (Val(source_color.G.ToString) - Val(search_color.G.ToString)) + (Val(source_color.B.ToString) - Val(search_color.B.ToString)) * (Val(source_color.B.ToString) - Val(search_color.B.ToString))) > sense)
End Function
wich is working ok for pixelbypixel search! but i dont want pixelbypixel search or do want i dont know thats why i posted a link to rapidshare file and application with source wich contains my needs!
Dave Kreskowiak wrote: If all you're doing is OCR'ing the business cards, why even bother comparing two images of the cards and just compare the data that's coming off them?
no i am not doing ocr. i have button "start" and then i scan image and compare to an image that is stored to database and detect difference on those two images and pixelbypixel is slow and not good result but with the code for detect difference from link i posted would do what i want! Here are images you can try with the application i posted and see what i want!
ORIGINAL : http://img96.imageshack.us/img96/3540/originalsp.jpg[^]
SCANED : http://img717.imageshack.us/img717/3461/damaged.jpg[^]
COMPARED : http://img32.imageshack.us/img32/5895/comparator.jpg[^]
Dave Kreskowiak wrote: If you have to compare the images, then you'll have to implement a filter (in C#, not VB.NET!) to process the image to equalize the colors. For example, if you look at the white part of a business card, you'll see a scattering of pixels of different colors, not an even white acrossed all of them. You have to implement a filter to remove all those color variations to generate the nice flat color acrossed all pixels.
yes i want compare... look at compared picture!
Dave Kreskowiak wrote: Search the articles for "image processing for dummies" and you'll find some good examples by Christian Graus.
thanks i will!
|
|
|
|
|
Pf course your search is slow! First, you're using GetPixel, which takes an eternity to execute. Second, this code is garbage:
CheckPixel = (System.Math.Sqrt((Val(source_color.R.ToString) - Val(search_color.R.ToString)) * (Val(source_color.R.ToString) - Val(search_color.R.ToString)) + (Val(source_color.G.ToString) - Val(search_color.G.ToString)) * (Val(source_color.G.ToString) - Val(search_color.G.ToString)) + (Val(source_color.B.ToString) - Val(search_color.B.ToString)) * (Val(source_color.B.ToString) - Val(search_color.B.ToString))) > sense)
Your converting each RGB value component, say R, to a string, then back to a value. This is VERY time consuming an completely unnecessary. Not only are you doing it at all, you're doing it several times for each time you use the same value!
The only way you're going to improve performance is to scrap this code and rewrite it in C# and directly access the image data. You cannot do this in VB.NET because it requires the use of unsafe pointers, which VB.NET does not support.
Search the articles for "image processing for dummies" and you'll find a very good series of articles by Christian Graus explaining just how this is done.
|
|
|
|
|
|
i removed video becose of some e-mails i got last 2 hours
|
|
|
|
|
FeRtoll wrote: I concluded from this only one thing, you dont like vb.net annymore and force to the c#!
First, I already told you why you could not do this entirely in VB.NET. Go back and re-read it.
FeRtoll wrote: Dave Kreskowiak wrote:
Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...
Because I've spent far more time with my son than here. That's all...
FeRtoll wrote: in c# yes, but i am here asking for vb.net!
There is no equivilent in VB.NET. I already told you VB.NET does not support pointers, making writing it in VB.NET impossible.
FeRtoll wrote: I would prefer to learn assembler rather than c#,
Waste your time however you want. C# is so very close to VB.NET, so you know more about it than you realize.
FeRtoll wrote: and how people say it... i am joking!
I'm not...
|
|
|
|
|
Don't worry , be happy!
hey dont get mad, i respect your opinion and help!
|
|
|
|
|
Hello everyone,
I currently have an infragistics ultrawingrid that takes input in a cell and when tabbed, it updates database and refreshes the grid but the tab goes to the next control. I need the tab to go to the next cell. This is not a problem in the designer its a problem with the grid being refreshed in the hard code and it has to be refreshed because other values have dependency on the values being entered. does anyone have any ideas or any reference to how i can achieve this.
Any comment or suggestion is appreciated
|
|
|
|
|
A better place to ask this question is here[^].
|
|
|
|
|
Hi,
How can I find out what type of disc is in the dvd/cd reader.
I found
- System.IO.DriveInfo(driveLetter)
- FileSystemobject with drives
- Directory.GetLogicalDrives
But non of these tells me what type of disc is in the machine. How can I find this?
Jan
|
|
|
|
|
I don't think there's a direct property but System.IO.DriveInfo has Totalsize so you could work it out from that, no?
|
|
|
|
|
|
Press eject
|
|
|
|
|
you can do that by a simple P/Invoke:
mciSendStringA("set CDAudio door open", "", 0, 0)
and that also works for data CD and DVD
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
How do you make an input that the user key in a textbox to be a percentage number?
|
|
|
|
|
Ummmm, Divide (/) by 100
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Just make it a number and put a label with "%" in it behind.
Then on change parse the value to %
Easier than messing around with controlling inputs.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Use a NumericUpDown with the max/min set to 100/0, and a label next to it for the % sign.
|
|
|
|
|
Hello Everybody,
I am trying to print the Image which have the text. It printing properly. But in Text Portion Displays some distervence in printing.
Thanks
If you can think then I Can.
|
|
|
|
|
Sorry, but i haven't got a clue what you are talking about, it doesn't make alot of sense.
Can you maybe reword it.....
|
|
|
|
|
I am Creating an Image by using Text. It is showing fine. But I am Trying to print this Image then the Text Quality is not Fine.
Code Is simple
g.DrawImage(this.Ibarcode , DrawRectangle)
If you can think then I Can.
|
|
|
|