|
Hi Dave, thanks for your answer, actually I have limited experience with VB.NET, I have been working in a software to use it in my work but I am learning on the way, anytime I need to do something I do a research and apply it on my software but this will be a personal project. I am also new on the page, is my first post asking help.
What I would like to do is kind of emulate the process done by the computer mouse. It has a low res cam that take images form the surface and compare them to get the delta X and delta Y. also the trackpad of an Blackberry phone uses the same principies. to help you understand watch this video to see what I want to learn to do.
http://www.youtube.com/watch?v=57kTrKJHOjM
Thanks a lot.
|
|
|
|
|
OK, so you're taking consecutive pictures and comparing them to see which way the picture has moved.
The problem with this is that you cannot do a pixel-by-pixel comparison as you have to no idea how far the image has moved and which way the image shifted.
You have to look for items in the image and track those items. THIS IS NOT A TRIVIAL TASK!
Look into the AForge[^] library to help with the "computer vision".
|
|
|
|
|
how do i extract specific data in excel into a database
|
|
|
|
|
Okay thanks hey.
I have multiples excel file report. I'm suppose to extract data from those excel file save it in a database so that i can have 1 big report.
so far i am able to browse the file and save data into a dataset. I want to read into data and extract certain data that i need only. im stuck when looping ;P ;P ;P
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim fBrowse As New OpenFileDialog
With fBrowse
.Filter = "Excel files(*.xlsx)|*.xlsx|All files (*.*)|*.*"
.FilterIndex = 1
.Title = "Import data from Excel file"
End With
If fBrowse.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim fname As String
fname = fBrowse.FileName
MyConnection = New System.Data.OleDb.OleDbConnection("Provider= Microsoft.Jet.OLEDB.4.0; Data Source='" & fname & " '; " & "Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Apr14$]", MyConnection)
MyCommand.TableMappings.Add("Table", "Billing_report")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
MyConnection.Close()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(fname)
Dim line As String
line = sr.ReadLine().Trim
Dim n As Integer
Do While line.StartsWith("CNC")
sr.ReadLine()
If line.StartsWith("CNC") Then
line.Substring(10, 11).Length.ToString().Trim()
n += 1
If line.Contains("Circuit no") Then
End If
End If
Loop
End If
|
|
|
|
|
This question answered in Q&A. Please do not post the same question in multiple forums.
|
|
|
|
|
hi i am new to use visual basic. i want to make a clock timer of window application please give me some suggession ?
zubizubi
|
|
|
|
|
|
I have a windows form app that references a library. I want to deploy the app to a different machine and I don't know the name/location for the reference on that machine. Can I edit a config file to include the reference for the new machine? And can you point me to an example, please? I can use either VB6 or VB.net with VS 2010. Thank you for your help.
Bobby
|
|
|
|
|
A "reference" is only valid at compile-time and only works with COM-based and .NET libraries.
If you're using a COM-based library, the registration information in the registry is all that is needed.
If using a .NET library, all you need is the library in the same folder as the .EXE that's using it.
You don't provide this information at runtime.
|
|
|
|
|
Thanks, Dave. And looking at the build action, seems like the library has to be on the development machine, too.
And, do I only need the .tlb file for the target application?
Bobby
modified 28-Oct-14 17:39pm.
|
|
|
|
|
Tlb's are for COM objects ... you may need to register the reference on the other computer... look into regsvr32
Kris
|
|
|
|
|
Thanks, Kris. The library will already be registered on the client. I'll see how it goes.
Bobby
|
|
|
|
|
Hey all!
I am new to VB.Net, but have extensive knowledge in Event/Procedural Programming. I am looking for ideas on a useful application, that can help me gain more understanding of syntax and general procedures. Anyone have an idea of something I can build, as a local application with data storage? I have used Pervasive PSQL database, but have not used MySQL or SQL Server. Pervasive uses PSQL scripting language, which is generally the same as SQL. Maybe something simple that uses flat files for data storage? Just need a direction to start in.
Brian Lefler
Programmer/Analyst
|
|
|
|
|
How about a gas mileage tracker? A table for cars, a table for fill-ups, UI to enter data, etc.
P.S. I was just looking at a page for Pervasive PSQL, but it's unclear what it is. I see no articles about it here on CP. If you have experience, maybe you'd like to write up something about it.
modified 25-Oct-14 16:20pm.
|
|
|
|
|
Great! Thanks. I was trying to figure out how to use an xml document to store the data, but cannot find any examples that use the same class methods to both create, and modify existing documents. I found references to xmlWriter for creating the XML, and xmlDocument to modify existing. I am trying to find something that will give an example to say;
Dim filepath as String = "C:\TestXML"
If File.Exists(filepath) = False) Then
'I need to know best practice to create the file here. What class, methods, etc...
Else
'I need to know best practice to edit the existing file. I mainly need an example of how to add
an additional node name/value pair here.
Endif
Is this something you can help with, or maybe provide an example? I appreciate everything.
|
|
|
|
|
|
Thank you for the article list. Unfortunately, none of them answer the question of, after initial creation of the XML, how can I add additional nodes, and/or edit existing nodes. I am working on a user/password manager.
So, I have a form with textbox/labels representing "ID", "Title", "User", "Pass", "Notes". I also have a "Save" button. On the save button, if the file doesn't exist, create it. (I know how to create the file from scratch.) If the file exists already, how do I traverse to the end of the node set, and add an additional node, with each of the name/value pairs mentioned above. Does anyone have an example of this?
Thank you in advance.
Also, I have a datagridview that I will use to display all existing records. I can tackle this at a later time though. I thought maybe I could use the load sub, to load the existing xml (if it exists) into the dgv. Use the form controls to maintain the values in the dgv. At the unload of the program, delete the xml, and create from scratch, based on values from the dgv. Is that a good method? Below is an example of the xml output I hope to accomplish:
<LIMGRTable>
<Record>
<ID>1</ID>
<Title>Facebook</Title>
<User>MyUserName</User>
<Pass>P@ssword</Pass>
<Notes>My Notes Here</Notes>
</Record>
<Record>
<ID>2</ID>
<Title>Gmail</Title>
<User>soandso@gmail.com</User>
<Pass>P@ssword</Pass>
<Notes>My Notes Again</Notes>
</Record>
</LIMGRTable>
Brian Lefler
|
|
|
|
|
Sorry I don't have an actual example, I just did a search for "XML + VB.NET", you may need to do further searches to find samples that help to answer your question. You should also understand that storing passwords in a text file is not a good thing to do, as anyone can get at them. Passwords should be hashed so that they cannot be read, or even decrypted, before being saved.
|
|
|
|
|
Thank you for your response. I am not actually building an app that I will active store actual passwords in. This is just an attempt to learn more of the VB.Net Language. Thank you again.
|
|
|
|
|
I never did get any good or practice these in the past, I can't even remember what there called
But I know it's a if then else statement.
Just wondering if someone could translate this for me to vb, or help me with the keywords to look up a tutorial on this.
context.Request.Url.Port == 80 ? string.Empty : ":" + context.Request.Url.Port
|
|
|
|
|
I think I got it, it may be a tenary Operator
If(m_Context.Request.Url.Port = 80, String.Empty, ":" & m_Context.Request.Url.Port)
|
|
|
|
|
Keep in mind that there is no direct replacement in VB.NET for C#'s ternary operator.
What you have may work, but there is a problem. Since IF() and IIF() are both methods, ALL arguments being passed to them are evaluated. This is not true in the C# operator.
For example, if you have C# code that reads:
string value = someObject.someProp == 0 ? myObject.prop + "something" : otherObject.prop
What if myObject is null when someObject.someProp does not equal 0? In C#, this wouldn't be a problem because the first return value (between the ? and colon) does not get evaluated when the statement is executed.
In the VB.NET version of the code:
Dim value As String = If(someObject.someProp = 0, myObject.prop + "something", otherObject.prop)
will throw an exception because you can't return the prop property on a Nothing object (myObject ).
|
|
|
|
|
Dave Kreskowiak wrote: Since IF() and IIF() are both methods, ALL arguments being passed to them are evaluated.
Not true - the IF operator[^], added in .NET 3.5, is directly equivalent to the C# ternary operator.
Your comment is true for the old IIF function[^], but that's not what the OP is using.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ah, it might help if I read the documentation again, wouldn't it!
|
|
|
|
|
It always helps!
For instance, I hadn't realized that the IF operator also has a two-argument version which is the equivalent of the null-coalescing operator (?? ).
But then, since I don't use VB.NET, it doesn't really affect me.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|