|
More information needed!
Why do you need to do this? The msi will quite happily do its stuff without you knowing where it is.
Or are you saying that you need to get this information from within a setup project that you are creating?
You see, with what you've given us, it is almost impossible to help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
That's a bit of a problem. Code running inside the .MSI really should not care about the path to the launched .MSI. Since everything it's dealing with is contained within the .MSI, a properly designed installer shouldn't have to deal with outside files/components.
What are you trying to do with this??
|
|
|
|
|
Hi, I am having problem to update the database from the changes made to DGV.
Following is the code and line in the bold doesn't update the database. Please help me
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Db1DataSet.Sheet1' table. You can move, or remove it, as needed.
Me.Sheet1TableAdapter.Fill(Me.Db1DataSet.Sheet1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
Dim fi As New FileInfo(OpenFileDialog1.FileName)
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Text;Data Source=" & fi.DirectoryName
Dim objConn As New OleDbConnection(sConnectionString)
Dim objDataSet As DataSet = New DataSet()
objConn.Open()
Dim objCmdSelect As New OleDbCommand("SELECT * FROM " & fi.Name, objConn)
Dim objAdapter1 As New OleDbDataAdapter
objAdapter1.SelectCommand = objCmdSelect
objAdapter1.Fill(objDataSet, "test")
DataGridView1.DataSource = objDataSet.Tables(0).DefaultView
objConn.Close()
Me.Sheet1TableAdapter.Update(Me.Db1DataSet.Sheet1)
End If
End Sub
modified on Saturday, April 11, 2009 3:26 AM
|
|
|
|
|
What sort of database, looks like an old DBF connection method.
I suspect this has nothing to do with a database but is an attempt to read in excel files!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
its access database in addition to the csv file.
Reading from csv file into DGV and updating an existing access database from that DGV. I hope I made it clear.
|
|
|
|
|
Well, I can tell your SQL statement is wrong. Your code says something like this:
SELECT * FROM C:\folder\somefile.mdf
which will not work at all. You're trying to try a file path as a table in SQL. You have to provide a TABLE name in the database to the SQL statement, not a file path.
Seriously, you're missing the very basic concepts of working with databases. I highly suggest picking up a book on VB.NET and ADO.NET and working through them.
|
|
|
|
|
I have an app that needs to delete a file or move it from an external drive
My app works fine in XP but fails in Vista because permissions are not set
I have tracked down the following but some properties are not correct for vb,net 2005 with net framework 2.0
## copied source details:
For those interested I have found a way to allow the permissions I set to be inherited for the folder/directory in question and all subfolders and files.
Apparently you must add a rule for each condition folder, folder objects and the container
Below is the additions:
Public Sub AddSecurityAttribute()
Dim directoryInfo As New DirectoryInfo(Me.FolderName)
Dim directorySecurity As AccessControl.DirectorySecurity = directoryInfo.GetAccessControl
' Add Security to This Folder, Subfolders and Files
' Must include an access rule for each condition
directorySecurity.AddAccessRule(New AccessControl.FileSystemAccessRule(Me.UserAccount, Me.FileRights, AccessControl.InheritanceFlags.ObjectInherit, AccessControl.PropagationFlags.InheritOnly, Me.ControlType))
directorySecurity.AddAccessRule(New AccessControl.FileSystemAccessRule(Me.UserAccount, Me.FileRights, AccessControl.InheritanceFlags.ContainerInherit, AccessControl.PropagationFlags.InheritOnly, Me.ControlType))
directorySecurity.AddAccessRule(New AccessControl.FileSystemAccessRule(Me.UserAccount, Me.FileRights, Me.ControlType))
directoryInfo.SetAccessControl(directorySecurity)
End Sub
Remember this is VB.NET 2.0 code, the AccessControl Class is new to the 2.0 framework.
any help much appreciated
|
|
|
|
|
Run your Application as Administrtor. For Running application as admin you should need of Menifest.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Thanks for replying,
However, I am designing the app for other users who may or may not be administrator
With myself running this app as administrator I am also having the poroblem, so I need code to set permissions for the drive\folder to allow delete & move of files from an external drive
|
|
|
|
|
If you are login with administrator then it will running properly else it will required password of administrator.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Ihave run the application as administrator & I am getting this error message as shown in my question
It is my understanding that for Vista permissions are required in the program code to allow delete or move of files from an external drive
|
|
|
|
|
What error message is shown by Program.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
this is the error message
full error text:
************** Exception Text **************
System.UnauthorizedAccessException: Access to the path is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.File.Move(String sourceFileName, String destFileName)
at Test_Ainfo.frmMain.btnMove_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
now, The problem is because I want to delete or move a file from an external drive, ie f or g, or h
I want somebody to tell me one of the following:
1. this is the code you need to add permissions to the drive\folder to do this
2. this is the code you need to get administrator permission
3. this is the code to both the above
4. it can't be done
surely I am not the only one with this problem, but where is the answer?
|
|
|
|
|
Right Click on Your Application.exe then Run it as Administrator.then check it.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
It seems as though I can't get any answers to this problem
I have also logged it on 2 other forums with same result
So at the present time I will close this post in this forum
Thanks for your contribution
|
|
|
|
|
Hey guys if anyone could help me this would be extremely appreciated. My homework assignment is to take a checking account program that we've already written and add function procedures to it. The exact instructions are: Write function procedures for processing deposits, checks, and service charges. Deposit function adds the deposit to the balance; the check subtracts the transaction amount from the balance; the service charge function subtracts the amount from the balance. each of the functions must return the updated balance.
Again, this program currently works as it is right now but we have to tweak the code to include function procedures as per the above mentioned directions.
<pre>
Private Sub CalculateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateToolStripMenuItem.Click
Try
If Decimal.Parse(AmountTextBox.Text) > 0 Then
'assigns the variable
amountDecimal = Decimal.Parse(AmountTextBox.Text)
'checks to see which Radio button is checked and performs calculations
If DepositRadioButton.Checked Then
newbalanceDecimal += amountDecimal
totalamountdepositsDecimal += amountDecimal
totaldepositsInteger += 1
ElseIf CheckRadioButton.Checked Then
'checks to see if balance is greater than the amount entered
If newbalanceDecimal >= amountDecimal Then
newbalanceDecimal -= amountDecimal
totalchecksInteger += 1
totalamountchecksDecimal += amountDecimal
'If amount entered is more than the balance then give an error and deduct 10 bux from balance
Else
MessageBox.Show("Insufficient Funds")
newbalanceDecimal -= 10
totalamountchecksDecimal += 10
totalservicechargesInteger += 1
End If
ElseIf ServiceChargeRadioButton.Checked Then
newbalanceDecimal -= amountDecimal
totalamountservicechargesDecimal += amountDecimal
totalservicechargesInteger += 1
'If no radio button is selected then give an error
Else
MessageBox.Show("You must select either Deposit, Checking, or Service Charge" _
, "Selection Required", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
'displays the final total in textbox
NewBalanceTextBox.Text = newbalanceDecimal.ToString("C")
'enable the summary menu
SummaryToolStripMenuItem.Enabled = True
'if numeric values are not entered then give an error
Else
MessageBox.Show("You CANNOT enter negative numbers into the Amount of Transaction textbox" _
, "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Catch
MessageBox.Show("You must enter numbers into the Amount textbox", "Invalid Input" _
, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
|
|
|
|
|
So what's the problem?? No, we're not going to write your code for you. You wouldn't learn anything if we did that.
|
|
|
|
|
That's where your completely wrong. if someone would write one of the functions for me I would see how it's done and be able to do it again on my own. If you dont know the answer dont bother posting.
|
|
|
|
|
Boblc123 wrote: able to do it again on my own
Until your next homework assignment. We are here to help not do it for you.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
At least he admitted it was homework!
------------------------------------
"I am always serious about what I do, not necessarily about how I do it."
Tom Baker
|
|
|
|
|
Dalek Dave wrote: he admitted it was homework
Probably the only thing saving him from a flame-fest
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Boblc123 wrote: if someone would write one of the functions for me I would see how it's done and be able to do it again on my own.
You stated in your original assignment that you needed to write three functions. I take it that you'll model the other two yourself, once you got an idea of what is expected?
I are troll
|
|
|
|
|
Oh, I know the answer all right. Do you really think we all haven't had the same homework assignment??
I could write it up in about 15 minutes, but you'd still fail. The problem is coding style. Everyone writes code a bit differently, and mine would make the rest of your code VERY different. I'd also probably be using stuff that you haven't covered in class yet.
This is where you make the initial attempt at it, get stuck, then start asking questions.
|
|
|
|
|
You are an idiot. But just wanted everyone to know that I got help on another forum. So you can all go f*** yourselves. You stupid geeky no good son of a bitches who like to talk sh*t in forums because you know if you did it in real life you'd get your f***in face smashed in.
|
|
|
|
|
Boblc123 wrote: who like to talk sh*t in forums
I wasn't "talkin' sh*t". I was just mearly pointing out the truth.
Have fun failing your class...
...Oh! I hope you don't tell a prospective employer what your name is. These forum posts tend to show up in Google and Yahoo searches pretty fast, and, you know, the Internet never forgets, right?
|
|
|
|