For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
i want to blink 2 and 3rd row(not particular row because i have many rows in my database) because column enddate has todays date. likewise i want to blink each row if only column enddate is todaysdate.
Why dont you write the code on RowDataBound. Something like:
Private Sub GridView_RowDataBound(sender As [Object], e As GridViewRowEventArgs)
If e.Row.RowType.Equals(DataControlRowType.DataRow) Then
If Convert.ToDateTime(e.Row.Cells(4).Text) = DateTime.Now.[Date] Then
I have an application in VB6 from which I print a report with Crystal Reports 4.0.
For example, when I set a printer as the default printer pdf, when you open the dialog box to save the pdf file in the File name field I wrote "Seagate Crystal Reports - xxxxx.pdf."
How do I set this code to the file name that comes by default?
Which Crystal Report I have set to change the name of the file / print?
I've seen a lot of discussion on this subject, but no real solution. I get the problem on one machine but on another the program works correctly. I'm using Visual Studio express 2013, but all the "solutions" I've seen refer to Visual Basic 2010 and the "solution" doesn't seem to work with VS Express 2013. Any help would really be appreciated.
I've used ADO but ADODB is easier for me to use and I've used it for many years (I'm 81 now so I've used about all the languages there are over time). But, I like ADODB for Visual Basic, and it has always worked correctly until Microsoft started messing with it. So, was that your solution?
It was just a suggestion. ADODB is definitely an "ex-parrot" now; it hasn't been updated since .NET was released, and although it still works, it's not supported.
Using ADODB from a .NET application is going to be significantly slower than using ADO.NET, since your .NET code has to talk to a COM wrapper for ADODB. It also has significantly less features that ADO.NET, and makes many operations harder than they need to be.
That is the "solution" that I've seen from several others, but in VS 2013 there doesn't seem to be any way to do that. I've tried every way I can think of. If you have a suggestion as to how; I will certainly try it.
Well that sort of worked: As long as I was still in VS 2013 it worked. If I compiled the release version, it didn't. I got a message "could not load...." but this time showing only "culture=neutral" and "PublicKeyToken=null". But the release version still works on the original machine. I think it's demon-possessed. I may have to break down and take your advice and redo a version using ADO instead of ADODB (assuming at my age I have enough time left). I hate that. I might even have to switch to SQL Server, but I haven't tried to use that in a long time. I hate that even worse.
But the release version still works on the original machine.
Did you also include the "Copy Local" setting? If those types aren't embedded then it will look for them on the installation somewhere. In the GAC and the local working-directory (often the same folder as the executable), and to make things worse, if the app is compiled for 32-bits it won't be able to load with a 64-bits version of that library. You'd need a copy of that library in your working-folder.
Go the the properties of the reference again, where those settings are. There's also a property called "Path", and that would contain the complete path to the library that is referenced on the development machine. Copy that file into the \debug folder
Ed Barnes wrote:
I think it's demon-possessed.
Being in a DLL-Hel is worse than that though.
Ed Barnes wrote:
I may have to break down and take your advice and redo a version using ADO
instead of ADODB
If you struggle with ADO.NET, simply come back and post the question.
Ed Barnes wrote:
I might even have to switch to SQL Server, but I haven't tried to use that in a long time. I hate that even worse.
If you want to go that way, there's a relative easy migration; design your tables in MS-Access as usual. There should be an "upsize wizard" in the developers-menu that converts the Access-database to SQL Server format. Once that is done, one can create a new Access database that links to the tables in SQL Server, so one can work with them from Access.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
Thanks. I checked the copy local and it was set correctly. I even checked the version of ADODB.dll and it was the same as on the original machine and the Path was correct. IF I were to take the route of moving from ADODB to OleDB, what would be the best (easiest? Most straightforward?) way to go about it, other than recoding the whole program to get rid of ADODB recordsets: Datasets? DataTables? DataAdapter? I've never done an entire program using OleDb that I can remember (of course at my advanced age of 81, what I remember and what is a fact may be completely different)
Hi, i have been thinking a long time in making a software to use my webcam to control the mouse on my PC, I have been searching but I can not find something based on VB.NET (I only work with VB and I have limited experience). So I want to tell you what I have been thinking hoping you can help me.
I only need to take real time video, convert it into images, compare the new image with the last one and find if there is a change in the position, calculate how much it change in X and Y and take those values to set mouse pointer movement (I mean if the image change 1 pixel in the Y axis then make the mouse move 1 pixel in the same direction). Most software focus on one object, may be one hand, one color, etc. What I need is just to use the whole image to know if it moves and where does it moves. This is because I wont use the cam standing on my desk, I want to hack it and use it as a laser pointer, so where I aim my cam in an image projected by a video-beam there will be the mouse.
Hope I made myself clear and you could help me.
Thanks in advance.
You might want to examine, very closely, two consecutive images you get from a web cam before you put a ton of effort into this project. EVERY image is different, all over the image. What you consider to be a "change" must be under a threshold value.
Also, since most monitors today exceed the resolution of a web cam, you'll find that your definition of a "pixel" is not going to be anywhere close to "precise".
What do you mean by "video beam"? Are you talking about a non-moving laser spot on a wall?
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
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
.Filter = "Excel files(*.xlsx)|*.xlsx|All files (*.*)|*.*"
.FilterIndex = 1
.Title = "Import data from Excel file"
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)
DtSet = New System.Data.DataSet
DataGridView1.DataSource = DtSet.Tables(0)
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")
If line.StartsWith("CNC") Then
n += 1
If line.Contains("Circuit no") Then
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.
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.
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...
'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.
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:
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.
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 AsString = 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).
It's for my ckEditor file browser program, sort of a plugin, in which I have to calculate the physical path of the image file and the virtual path, and pass it back to ckEditor.
This is the last part of the original vision for my eCommerce software that I started 6 years ago in vb or asp.net. It's almost done, been working on it for over 200 hours.So with this program, you can build a template in your web browser, save it as a job, and book the job and email it out to your mailing list, using the web service that I built.
I'll look at the URI article today, and see if I can use some of the knowledge from it.
Thanks for listening, and helping me out. I really appreciate it.
'Get the Domain name of the website
Dim m_urlPrefix AsString = String.Format(
If(m_Context.Request.Url.Port = 80, String.Empty, ":" & m_Context.Request.Url.Port),
The final url is for a email campaign, in a port 80 environment. So regular people will be viewing the final url of the image, and wont be 443. Mail browsers and Outlook type programs will be using the URL.
Please I have DatagridView bound to a DataTable that pulls records and displays the DataGridView correctly. Now, I have ColumnType as DataGridViewComboBoxColumn of the forth column named "Username". When I click the combo box of the DataGridview, nothing gets displayed at all. I just don't understand it. Below is the code.
'Objects already initialized
Dim QueryU As String = "select * from Users where username='" & frmUsers.txtUsername.Text & "'" Dim daUser As New SqlDataAdapter(QueryU, SQLCon) Dim dtUser As New DataTable daUser.Fill(dtUser) If dtUser.Rows.Count > 0 Then