|
Hello Dave Kreskowiak,
please believe me its not a homework assignment. actually I am doing it as a part of the development. I have been trying :
objAdapter1.Update(Me.Db1DataSet.Sheet1)
but its not working. I just want your help on updating the database with this datgridview that's all. Rest I can do. Please help me!
|
|
|
|
|
rajulama wrote: I just want your help on updating the database
A word of advice, the verb to Want is too abrasive to use when you are the one making a request from a position of weakness. It's better to use the subjective, i.e. "would like". Same principal I know applies in Spanish and German and I would expect to be fairly universal. Put simply it's the polite way to make a request of somebody you have no authority over.
Not that it'll help you here, mind.
Also, for the love of God, use a decent naming system!
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
sorry,
I would be really grateful to you if you could help me. Please don't mind. Help me out, please!
|
|
|
|
|
MidwestLimey was correct and you're still not quite getting it. It's not polite to ask for help and then in the same request demand it with an exclamation mark. So lets practice as if you were going to ask for help from Dave, you could try kissing his a$$ a little like:
"Dave the almighty who rules next to Xerxes - could you find it in your gracious heart to feel pity upon my disgraced soul and help me with my problem? I am nothing without your assistance and bow before your presence."
Or...........you could simply ask for help without it demanding, caps, or !s. Your problem does kind of look like a homework assignment.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Jon_Boy wrote: "Dave the almighty who rules next to Xerxes - could you find it in your gracious heart to feel pity upon my disgraced soul and help me with my problem? I am nothing without your assistance and bow before your presence."
OK, OK, I don't need to be wiping your lipstick off my ass!
|
|
|
|
|
+5 for the wit, -5 for not wanting a little lipstick on the ass.
|
|
|
|
|
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()
After this I wrote:
objAdapter1.Update(Me.Db1DataSet.Sheet1("test"))
Because the dataset that I want to update is in by DB1DataSet.Sheet1. I dont want to update the datagridview itself. I want to update an existing database called DB1DataSet.Sheet1 from the datagridview.
when I wrote above line its says following error:
Error 1 Overload resolution failed because no accessible 'Update' can be called with these arguments:
'Public Function Update(dataTable As System.Data.DataTable) As Integer': Value of type 'WindowsApplication1.db1DataSet.Sheet1Row' cannot be converted to 'System.Data.DataTable'.
'Public Function Update(dataRows() As System.Data.DataRow) As Integer': Value of type 'WindowsApplication1.db1DataSet.Sheet1Row' cannot be converted to '1-dimensional array of System.Data.DataRow'.
'Public Overrides Function Update(dataSet As System.Data.DataSet) As Integer': Value of type 'WindowsApplication1.db1DataSet.Sheet1Row' cannot be converted to 'System.Data.DataSet'.
|
|
|
|
|
rajulama wrote: but its not working
If you want help, you have to give more information. What isn't working? What error message are you getting? Show us what code you have so far. We're not going to do your work for you, but if you have a specific problem we can try to point you in the right direction to get help.
|
|
|
|
|
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()
End If
I have this and now to replace the data in existing database with that in datagridview I am using:
objAdapter1.Update(Me.dataset.filename)
But its not making any change in dataset table.rest is ok.
|
|
|
|
|
Show us the code around your update statement. Is your command still setup when you issue the update? Shouldn't your update statement be something more like this:
odjAdapter1.Update(Me.objDataSet.Tables("test")) ??
|
|
|
|
|
rajulama wrote: please believe me its not a homework assignment
Ok, I'll take your word
rajulama wrote: actually I am doing it as a part of the development.
If I can not get my work done at my job, then I'll have to face the reality. Shouldn't you?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
When you right click on the desktop you get a context menu that has something like that:
-----------------------
Arrange Icons By
Refresh
-----------------------
Paste
Paste Shortcut
-----------------------
New
-----------------------
Properties
-----------------------
I need to add a link to my application on Desktop's context menu. How can I accomplish that? What registry key do I need to modify/add to get my app icon listed on the desktop context menu?
E.g.:
---------------------------
Arrange Icons By >
Refresh
---------------------------
My App Link >
Paste
Paste Shortcut
---------------------------
New
---------------------------
Properties
---------------------------
Please help. Thanks.
|
|
|
|
|
Not sure if we got it yet, could you post the question again? (snicker)
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
You posted the exact same question 4 hours ago. Don't. What you're doing is considered very rude and will only get you ignored.
We don't get paid to answer everyones questions. We do this on a volunteer basis, when we can, for as long as we can. Myself, I just woke up 30 minutes ago. Sorry if I wanted to get some breakfast before diving into your question.
|
|
|
|
|
Dave Kreskowiak wrote: I just woke up 30 minutes ago
Good Morning to you.
I don't know why you can't answer questions when you are asleep. I do some of my best work whilst asleep.
|
|
|
|
|
Now if only you could telepathically port your dream code into actual code......
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
All my coding works like a dream
(Well, in my dreams anyway)
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Ahhh...Breakfast was good! I get today off, so I slept in!
Now, where were we??
On yeah! Context menus and some guy who cross posts!
Here's an example for you import using RegEdit to add Notepad to the context menu:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\Notepad]
[HKEY_CLASSES_ROOT\*\shell\Notepad\command]
@="\"C:\\Windows\\Notepad.exe\" \"%1\""
|
|
|
|
|
Glad you got to start the day off right and I'm totally jealous of you getting the day off!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Sorry it is not working properly please provide me step by step solution. Thanks
|
|
|
|
|
OK, you save the sample I gave you as a .REG file. Just copy'n'paste it into Notepad to do that. Then you edit the registry data to provide the correct command line to launch your app, and write it in the correct format, escaping the proper characters as you go, then save it. Then you double-click that file so RegEdit will import it.
|
|
|
|
|
It's too long span plz provide me your answer
|
|
|
|
|
Uhhh...you realize this was over 2 years ago, correct??
I gave you everything you need to come up with your own solution. All it took was a tiny bit of effort on your part. No, I'm not coding this for you.
|
|
|
|
|
Hi
Hope someone might help me out, since I'm stuck.
I have to search the registry of several computers to find if there is a
"PendingFileenameOperation" waiting. After some try and error, I've come up
with this solution where I read the registry and add all entries' to an
array, and then add each arrayitem to a string. I then intend to search the
string for a certain path. If the count is above 0 I have a
PendingFileRenameOperation" that requires a reboot.
My problem is as follows:
1) Is this the best way to solve this problem
2) I cant get my regular expression to work.
The code I've come up with is as follows:
Dim objShell
dim strPending, strSessionManager , strAllText
Dim arrFiles ''array containing files that are being renamed
Set objRegEx = CreateObject("VBScript.Regexp")
objRegEx.Global = True
objRegEx.Pattern = "C:\Norman" ''regular expression finding all entries
containing "c:\norman\"
strPending = "PendingFileRenameOperations" ''The regkey we're going to read
strSessionManager="HKLM\System\CurrentControlSet\Control\Session Manager\"
''the registry
Set objShell = CreateObject("WScript.shell")
arrFiles=objShell.Regread(strSessionManager & strPending) 'put all entries
in registry into the array
for each StrFile in arrFiles
strAllText= strAllText & " " & strFile ''add all entries into one long
string with spaces
next
set colMatches = objRegEx.Execute(strAllText)
if colMatches.count > 0 then
''Do something if there are keys in the given directory that is pending a
filerename operation.
end if
Any feedback would be greatly appreciated.
modified on Friday, April 10, 2009 6:29 AM
|
|
|
|
|
Why are you putting all the strings into one massive string?? It's pointless. Just run the RegEx on each string you have in the collection.
I suggest you get Expresso[^]. It's a tool that let's you build and test Regular Expressions against any string data you provide.
But, since you're not really looking for a pattern, but just checking to see if the string starts with "C:\Norman", you can just use the InStr function to check this.
|
|
|
|