|
Hi,
I want to expand the current drive node at the form load
Please help me.
Thanks and Regards
Pankaj Garg
-- modified at 4:55 Wednesday 1st March, 2006
|
|
|
|
|
hello Pankaj,
i think you can refer to this link http://www.codeproject.com/vb/net/VbNetExpTree.asp
hope that i can help u to solve the problem...
besah
|
|
|
|
|
Hi,
Is this possible for a listbox?
When the listitems of the listbox are selected and right-clicked, a context menu appears.
Then, when the user right clicks on the empty space inside the listbox, the context menu will not appear even though an item is still selected.
If possible, what listbox event is used?
|
|
|
|
|
Hi,
U need to create menu on the form and make it invisible. Then on Mouse Down event of listbox check the value of button.
in this way
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbPopupMenuRightButton Then
Me.PopupMenu Me.file, vbPopupMenuCenterAlign
End If
End Sub
Noshaba
|
|
|
|
|
Hi All!
How do I associate the documents I save using my program to the program itself? Can't seem to do it. I right click the file and then open with... then I click on the vb.net program exe file that I have created but nothing seems to happen...
Thanks for any reply!
|
|
|
|
|
What do you mean "nothing happens"?? Nothing happens what you double click the document? Does your app launch, but no document is loaded??
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
When I try to open the document that I saved using my program, the "windows cannot open this file" dialog pops up. It does not know which program to use to open up my document. But I can actually open the document only when I open through the program.
|
|
|
|
|
It sounds like the association is messed up. Open Explorer and click on the Tools menu, Folder Options. Click on the File Types tab. Find your file extension in the list and click on it. Then click on the Advanced button. You should have an open item in the Actions box. Click that, then click Edit. The command line under Application used to perform action: box should look something like this (with the quotes!):
"C:\Program Files\someFolder\myApp.exe" "%1"
If the quotes are not there, the file paths will not get processed correctly and your app will get a list of command-line parameters like this:
myApp.exe C:\Documents and Settings\userId\File To Open.txt
The list of 5 parameters will look like this:
C:\Documents
and
Settings\userId\File
To
Open.txt
Depending on how you coded your app, the filename it'll try to open will be C:\Documents .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It sounds like the association is messed up. Open Explorer and click on the Tools menu, Folder Options. Click on the File Types tab. Find your file extension in the list and click on it. Then click on the Advanced button. You should have an open item in the Actions box. Click that, then click Edit. The command line under Application used to perform action: box should look something like this (with the quotes!):
"C:\Program Files\someFolder\myApp.exe" "%1"
If the quotes are not there, the file paths will not get processed correctly and your app will get a list of command-line parameters like this:
myApp.exe C:\Documents and Settings\userId\File To Open.txt
The list of 5 parameters will look like this:
C:\Documents
and
Settings\userId\File
To
Open.txt
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have actually done what you said before. I am unable to find my file extension in the list. I added manually and after that went to the advance section and configured the actions myself. I also change the icon. After I click OK I got back to the Folder option dialog. When I click the advance tab again, everything I edited and configured will haf disappeared...
|
|
|
|
|
I have no idea what you're doing wrong. Other than when you go back into the list, it's resorted alphabetically. You could attempt to create a New association and try to use the same extension and see what happens.
You might also want to try it using an admin account.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
After reading your post again, it would seem that your app is not written to handle command-line arguments. You might want to read up on the <a href="http://msdn2.microsoft.com/en-us/library/system.environment.getcommandlineargs.aspx" rel="nofollow">Environment.GetCommandLineArgs</a>[<a href="http://msdn2.microsoft.com/en-us/library/system.environment.getcommandlineargs.aspx" target="_blank" rel="nofollow" title="New Window">^</a>] method.
When you launch a documnet in the way you described, the associated process (or the one you pick in that dialog) is launched using a command line similar to:
C:\Program Files\SomeFolder\MyApp.exe C:\Path\To\SomeDocument.ext
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm using the RemoveTableRow method in the following code, which updates the dataset, however it doesn't ever update the database via the data adapter. Any one have any idea why? Much appreciative
(code generalized)
'Module level declaration
Dim mdrRow As DataSet.TableRow
'Retrieve datarow from dataset
mdrRow = DataSet.Table.FindByTableID(txtfield.Text)
with mdrRow
txtfield1.text = .field1
etc
end with
'Activated by a btnDelete
Dataset.Table.RemoveTableRow(mdrRow)
SQLDataAdapter.Update(DataSet)
DataSet.AcceptChanges()
When I attempt to retrieve from the dataset the row is no longer there, however it never updates to the database, so when the program terminates and the dataset is refilled the row is then back.
|
|
|
|
|
Perhaps you never really deleted the row? Check the RowState of the row in question before you attempt to write the data back to the database with the Update call. I get the feeling your code never really returns a DataRow object when it calls FindByTableID. There's no such method in the .NET Framework, so you had to write it somewhere. ...Or is this not a Copy and Paste version of your code???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
First, I thank you for your response.
Second, forgive me, I am new at VB.Net programming. I believe the row has to be deleted in the dataset. I'm using the FindByTableID method to populate a form when the program is first loaded, which also assigns the TableRow to the variable "mdrRow". At this time the row is retrieved to the form (successfully). If then, I click on the delete button the code DataSet.Table.RemoveTableRow(mdrRow) is then fired. At that point, if I attempt to retrieve that record using, again, the FindByTableID method the record is no longer found, which leaves me to believe it is indeed being removed from the dataset. However, when I close the program and then rerun it, thus refilling the dataset at form_load the record is now there (in the dataset) again. Can you tell me an example of how I would implement the RowState in this scenario, as I'm unfamiliar with that method.
Maybe my theory on this is all wrong. If you would like, and I would tremendously appreciate it, I can send you the exact code offline.
|
|
|
|
|
Each DataRow object has a RowState property. All you have to do is set a breakpoint on the code where you're deleting the Row, Dataset.Table.RemoveTableRow(mdrRow) , then look at the mdrRow object in the Watch window. Find the RowState property, then watch what happens to it when you hit F10 to single step through the code and run that one statement. If the RowState doesn't change to something like Deleted, the Adapter.Update statement won't know that is has to call the SQL delete statement for that row.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 8:19 Wednesday 1st March, 2006
|
|
|
|
|
Not sure if I'm doing this correctly;
I inserted a Breakpoint on the dataset.table.removetablerow(mdrRow) statement, then when I run the program a messagebox is displayed that states "There is no source code available for the current location." I then have a choice to look at the disassembly? I do see the Watch area but there is no name, values or types. Thank You.
|
|
|
|
|
Try setting the breakpoint to the first line at the beginning of the Sub where this code is, then stepping through it one line at a time.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
After you delete the row from the dataset are you updating the table on the database? Datasets are disconnected from the database so you need to run some type of delete stored procedure to get the data out of the database. Otherwise you're just emptying your dataset without really doing anything. Sorry if that's a dumb question but I didn't see anything to this effect in the code you've provided.
-------------------------------------
Do not do what has already been done.
Absolute power corrupts absolutely.. but it ROCKS absolutely, too.
|
|
|
|
|
Nicholas,
The only other code I have is:
DataAdapter.Update(DataSet)
DataSet.AcceptChanges()
Wouldn't this force the Dataset to Update the Database via the DataAdapter?
(Also, these da and ds are created in the form designer and not hard coded, if that makes a difference)
Thanks for your help!
|
|
|
|
|
Well, I would check and make sure the delete command on your DataAdapter is correct. As has been discussed before if this is being called correctly then for some reason your deleted row from the dataset isn't updating properly to the database. On your DataAdapter there is a property for the DELETE command, look at this and make sure everything in it is correct for the database you're trying to update. If so then I would go with what you've been recommended thus far.
-------------------------------------
Do not do what has already been done.
Absolute power corrupts absolutely.. but it ROCKS absolutely, too.
|
|
|
|
|
The Text is as follows:
DELETE FROM dbo.Authors WHERE (AuthorID = @Original_AuthorID) AND (Address = @Original_Address) AND (City = @Original_City) AND (EMailAddress = @Original_EMailAddress OR @Original_EMailAddress IS NULL AND EMailAddress IS NULL) AND (Name = @Original_Name) AND (PhoneNumber = @Original_PhoneNumber OR @Original_PhoneNumber IS NULL AND PhoneNumber IS NULL) AND (State = @Original_State) AND (ZipCode = @Original_ZipCode).
So assuming the mdrRow parameter is passing this info correctly, I don't see why it wouldn't work.
|
|
|
|
|
Yeah. I don't see anything there that wouldn't work correctly. Something must be wrong with the row deletion in the dataset. Sorry I couldn't help you more Good luck!
-------------------------------------
Do not do what has already been done.
Absolute power corrupts absolutely.. but it ROCKS absolutely, too.
|
|
|
|
|
No problem thanks for your input.
|
|
|
|
|
Hi,
i want to create a multiple datasets and bind it seperately. the query will look like
select * from table where id=ID
now,
if id = 1,
i want to generate dataset1 just for records with id=1 and
if id = 2,
i want to generate dataset2 just for records with id=2 and so forth
so that i can bind those datasets to different web control say for webchart component or a datagrid.
******
my initial idea was something like
in page load,
select distinct id from table.
while dr.read
function(dr("id"))
end while
function (String id as parameter)
{
Create new webcomponent
Create new dataset based on id
Bind data with the new instance of webcomp and dataset
}
==> all i am doing this is to generating multiple web chart using a dataset.
******
Please note id can be any value from null to 100 and the select statement can return 0 to n records based upon id.
hope my question makes sense.
please help!!!
|
|
|
|