|
In visual studio 2008 when I add field to the ACCESS database table its not making changes to DGV. However if I delete a field in database its deleting the contents but still showing the field in DGV. I am really puzzled.
Any prompt response would be appreciated.
|
|
|
|
|
The code you wrote, or dragged'n'dropped, is not automatically updated when you make changes to the database schema. You have to update any code you're written to deal with the new changes to the database. No, I really can't tell you the step-by-step on how to do it. There's just too much that you could have done and I have no way of knowing what needs to be changed and how.
|
|
|
|
|
hello frinds
i have problem that
i want to include connection string as file or procedder in my project but i didn t do it
plz help me
i well be thankful to you
|
|
|
|
|
shahzadfaisal wrote: i want to include connection string as file or procedder in my project but i didn t do it
Then you should.
There is nothing worse than putting things off!
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.”
|
|
|
|
|
You're harsh!
Funny!
But Harsh.
------------------------------------
"I am always serious about what I do, not necessarily about how I do it."
Tom Baker
|
|
|
|
|
I try.
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.”
|
|
|
|
|
Joking aside, add it as a Resource named ConnectionString, and use My.Resources.ConnectionString instead of the literal connection string
|
|
|
|
|
Hi,
Suppose if i have an test.msi in my machine and im xeecuting it (by double clicking on it..)now the requirement is i need to get the path of the msi from where it"s getting executed...Please help me...
|
|
|
|
|
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.
|
|
|
|