how to calculate the association with a database, containing two tables the first table price, and the second table of the goods, and the program in the language of Visual Studio 2010 Professional, using the Access database or sql no matter, the question is: How do I make the program take values from the table price, and calculates the cost of living depending on the equation Stored in the database??
I have two text box's and compare from two columns in database the result auto show another text box and then following below code using my program:
Public Sub cal() Dim sum As Double Dim res As Double With Common_Class.GetSrvRec("i_Unit_Con", "", "QTY_UNIT='" & txtitemunit1.Text.Trim & "'") If .Fields("QTY_UNIT").Value = txtitemunit1.Text Then [Code] .....
I'm having some trouble firstly trying to calculate the total of a column in the database connected to my vb.net project. Then I want to divide that total by the number of items in a listbox. This is my code so far:
Private Sub btnavresult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnavresult.Click Dim sqlx As OleDbCommand = New OleDbCommand
[Code]......
I get an error saying "No value given for one or more required parameters." when I try to run my program on this line "Dim rdr As OleDbDataReader = sqlx.ExecuteReader()"
how to calculate numeric values in a sql table in vb.net. For example I am developing a system which returns the required fields in GridView, I then copied the "NetValue" field in a list box. Is ther a way of calculating (adding them together) all the Net values listed in the list box? or is there a better way around it?
I'm developing Asset Management System, it will compute for straight line depreciation, my problem is how to calculate running total on each group that I've extracted from my database.Here's a snippet for my extraction of data
Private Sub cboAType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboAType.SelectedIndexChanged ListView1.Items.Clear() If Not cboAType.Text = "-" Then
I am trying to calculate the number of years for my calculate age event handler, however i am apparently missing a method or whatnot because im trying to calculate the age , can anyone suggest help on this. I need to subtract years to get my age but when i try the birthdate.Subtract (currentDate) method i get an error about not able to convert from LONG?
So below is what I have.
Private Sub btnCalculateAge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateAge.Click Dim currentDate As Date Dim BirthDate As Date Dim Age As Long
after downloading an emulator for the gameboy advance, all my icons hav turned to the adobe logo. When I double click on them, all that happens is the abobe reader comes up and says it can't open it. The only way I have found to open them is right clicking on them and hitting properties and clicking on shortcut ---> open file location and opening it from there.However I would like to open it regularly and I am not very computer savvy but I believe it has to due with file association.
I am trying to create a file association in my program, which requires me to create some keys in the registry. However, when I try to create the keys, I get a System.UnauthorizedAccessException.
I have tried searching for a solution, and the only thing I can find is various examples of passing a boolean value to request write access for the "OpenSubKey" method. My problem currently is not opening the key, it's creating it. I have tried several of the different overloads to no avail.
I am guessing that I will need to temporarily elevate the access of my app to create the registry key. What I don't want to do is permanently raise the access of my app just to accomodate this one, small function, which should only really be needed by the user one time in order to create the file association.
Here is my code in progress:
Private Sub chkSOPAssociation_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkSOPAssociation.Click If chkSOPAssociation.Checked = True Then
[Code]....
I have a checkbox on my form. When the user clicks it, it sets the file association if the checkbox is checked, or else it deletes the association if the checkbox is unchecked.
I'm trying to use Adobe's command line parameters to launch a PDF file with a user's search term passed in automatically. Unfortunately, Adobe's syntax for this command requires me to start Acrobat.exe (or AcroRdr32.exe) and pass in parameters, including the PDF file name.I have users that might have any version of Adobe Acrobat from 5.0 up, or they might be using Adobe Reader version 5.0 and up. I know when I double-click a PDF file, Windows has an association with that file that points to wherever Acrobat.exe (etc...) is installed to launch the program. How can I get access to that information?I've looked in the registry at"HKEY_CLASSES_ROOT.pdf", but don't see much in there that would lead me to "c:Program FilesAdobeAcrobat 8.0Acrobat.exe" or wherever the program is installed. Does anyone know how I can access this information?
I'm a bit of a n0ob to all this and I'm having trouble finding good resources on the net.What I'm trying to do is define a one-to-many relationship between two entities. I'm using the GUI tool in Visual Studio - and have created the tables in Microsoft SQL Server Management Studio.Basically, I have two tables....a 'Users' table and a 'Sites' table. A single user can have many sites associated with it.Users has a primary key of 'UID' and the Sites table as a primary key of 'Site_ID'.Sites also has a column 'UID' that should indicate which user that site is associated with.Anyway - it sounded pretty simple; but no matter what I attempt to do, I can't seem to get it to work. Mostly, I get validation errors - sometimes run-time errors, or sometimes, no actual data even though there should sites that match the UID of the user.I am able to connect and write LINQ against my Users table/pull down User objects - but can't seem to get it to know that the Sites are associated with the user.In the GUI - if I go to 'Add Association' and create a 1 to many link between Accounts and Sites - and Validate - I get an error saying, "Error1Error 11008: Association 'AccountsSites' is not mapped."
It seems like, when I try to make an association, it wants to link the 'Keys' of each entity.But U_ID and SITE_ID are the keys and, obviously, shouldn't match.If I click on the line it created in the GUI and I go to 'Table Mapping' I can see that it is trying to match those keys. Since I want it to match user_ids my first thought is to just make the U_ID the entity Key in the Sites entity but, of course, that's wrong because it would no longer allow a 1 to many relationship.
Ok, I'm trying to tackle this topic again. I have searched for setting file associations in the registry, and I only find references to adding the association the ClassesRoot, which, in Vista 64, throws an Access Denied exception.I would like to know if it is possible to set the association somewhere other than classesroot in the registry. Or, if it must be set in HKCR, then the proper way to temporarily elevate the application to perform the registry change.
What should happen is user clicks a button in my program to add the file associations, a Vista security dialog pops up prompting the user to confirm the operation or enter administrative username and password, user confirms, application sets the file associations, then drops back down to regular security.
I'm trying to do program that do something with F1 and F2 keys. So all working while my program is active. If my program is on screen. If I'm using other programs and my program isn't active on screen then these buttons won't do anything.
My code so far: This is under load program : Me.KeyPreview = True
This is when keys are pressed : Private Sub frmMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Select Case e.KeyCode Case Keys.F2 MessageBox.Show("F1") [Code] .....
I have a tab-based application that handles multiple documents. It is designed such that the user cannot run multiple instances of application. Furthermore, the user can double-click on a document file, and the application will launch itself and open it.[code]...
I am trying to remove the File Association I created in the Project properties tab 'Publish'/ 'Options'.I have tried deleting all the entries but is won't let me 'OK".Here is a picture of the evil dialogbox.
I have a multi-client DB (multitennant) with several tables.Two of these tables are tblEmployees and tblTitles.Now I have a relationship from tblEmployees.empTitle to tblTitles.ttlID.That far everything is working.But now I have to make the application for multiple clients/tennants.So I added the fields tblEmployees.empClient and tblTitles.ttlClient and included them into the association.This works fine for reading and for setting the persons title as well.But if I try to remove the title (set it to NULL), SQL to Linq tries to modify both tblEmployees.empTitle and tblEmploy ees. empClient with is not allowed because tblEmployees.empClient is part of the primary key.And so I get the following error:[code]How can I tell SQL to Linq only to modify field tblEmployees.empTitle???
ive got a custom archive type, which i have all the associations set to me application for, when the users double clicks these files i want them to auto import, but im a little stuck on my next step.[code]the tomove string would need to point at the file which was double clicked/ran, and the textbox1.text replaced with the file name of the file that was ran.[code]And the code runs, but i need to replace the "test" (previously it was textbox1.text) withthe name of the file which was ran, is that possible?
[ First off, this is not really a VB question -- it's a Windows 7 question, but when I posted it on a forum for Windows, a Windows "Support Engineer" suggested that I post it here. So here goes ... ]I have an old custom program (written in VB6) that opens a custom file type, but requires a qualifier in the command prior to the file name, similar to this:
myprogram.exe /i "myfile.seo"
The "/i" stands for "input file".
Back in Windows XP, I was able to make some very detailed changes to the file association for the ".SEO" file type, so that the "Open" action could contain this command:
myprogram.exe /i "%1"
The result was that I could click on any .SEO file and the filename would be substituted into the above command, in place of the %1. This did exactly what I needed.I have been unable to find a way to insert the command-qualifier "/i" into the file association in Windows 7.For a specific .SEO file, I can create a .BAT file, but that's a very limited 'solution'.
I have a very simple HTML reader for reading offline documents, and works very well when open using the menu. What do I need to do to get the reader to display the document I selected using by doing a double-click on the document name? The application will load, but the WebBrowser control stays blank. There's not a lot of code in the program so I will list it below.
Dim fName As String Private Sub OpenToolStripMenu_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles OpenToolStripMenu.Click OpenFileDialog1.Filter = "HTML Files|*.html" OpenFileDialog1.FilterIndex = 1 [Code] .....
I have an application that has a tabcontrol to handle multiple documents, just like Notepad++. And I also have file association working correctly with it.All I want to do is to make it open the double-clicked file onto a new "codetab" instead of creating a new instance of the program just to open a file.
Before I start, I'm not 100% sure this is the right place to ask. Okey, so I'm making my own Notepad, which will contain newer features. (Private use only though) One of them being tab control.
Now I want the program to be in the "Open With..." menus for all files, so I can choose myself.
And if the program is already running when user opens a new file, I want the text to appear in a new tab, instead of a new window of the program.
I tryed to be straight forward, and keep it short. So if you need more info, fell free to ask.
I have tried to do this before with a custom file type for a text editor. I barely got it to work... and now I can't even find those files. Now I just want for when I make my NSIS Setup that the file association can allow the mp3 player to play the files when the file itself is double clicked.
I am using Process.Start(fileName) to let Windows open certain files outside of my application with their 'default application'.If "fileName" for example is a ".txt" file, it opens the file in Notepad. If it is a folder, it opens windows explorer with that folder selected.This all seems to work well, except when the user enters a file that has no application 'linked' to it.(a file that has no file associations)I have wrapped the Process. Start() in a Try/Catch block so that any errors are caught and displayed.When I now open a file without any file associations (windows does not know with which application to open it) it tells me that it cannot find any application to open it with. (The exact error is in dutch so I don't think that's going to be much help here, but I think it's clear what's happening, no?)What I would like to happen in this case is that the windows "Open With" dialog comes up, asking the user to select an application to open the file with. Now it just displays the error message and continues, making it impossible for the user to open the file unless he browses to the file manually and sets up the file association, something many users probably don't know how to do.
In my database I have 3 tables Act, ActVisi and Visi. Table ActVisi is an association table between Act and Visi tables. In My EF4 data model the association table ActVisi is replaced by a many to many navigation property in both Acts and Visis entities.I want to select the entries whose Visicode=1 (in the ActVisi association table). I have tried the query below and it works when I remove Include("Visis").Where(Function e.Code = 1) but I am getting all the results. How can I make the below query work. I suspect that my lambda syntax in vb is incorrect.
I have two tables Products and Categories with a many to many relationship. I am trying to copy the categories linked to one product (OriginalProduct) to another product (newProduct). The problem is when I execute the SaveChanges() method, I not only get the records in my linking table, but it also creates another copy of the categories in the categories table. I've tried this in many ways but here are the last couple that I've attempted:
' Copy Product/Categories For Each oneProdCategory In OriginalProduct.Categories Dim relatedCategory = _productContext.GetObjectByKey(New EntityKey ("ProductInfoEntities.Categories", "RecordId", oneProdCategory.RecordId))
I'm running the following WMI script to get the associations between drive letters and physical drives on the system, but for some reason it omits CDROMs/DVD-ROMs. Can someone tell me how to get those as well?
Code: ComputerName = "." Set wmiServices = GetObject _ ("winmgmts:{impersonationLevel=Impersonate}!//" & ComputerName) Set wmiDiskDrives = wmiServices.ExecQuery _ ("SELECT DeviceID FROM Win32_DiskDrive")
I'm having a slight problem getting my program to load a save file when double clicking the save file.I'm using the Command$() to get the command line argument. I can open a save file by dragging it onto the exe. But not by double clicking the save file (after it's associated with the exe).I though dragging and dropping a file on a program and double clicking the file would open it in the same way, but I guess not.So in short how does file association work and how do I get the file path set to a var when the program loads.