|
You're welcome.
The question you posted is exactly the kind of thing we are here to help with. If you are using a book (even VB for Dummies), and trying, then don't hesitate to ask any questions here on this board, even if you think they might be "stupid" questions (which they aren't).
Good luck.
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi,
I have a arraylist full of paths and want to show them in a treeview( like in Konqueror )
but I do not manage it.
An example:
Dir1/
Dir1/SubDir1/SubDir2/
Dir1/SubDir1/AnotherSubDir1/
Dir1/SubDir3/SubDir4/Subdir5/
Dir1/AnotherSubdir2/SubDir5/
They are no real directories
Please help!
Thanky very much!!!
modified on Wednesday, August 5, 2009 9:33 AM
|
|
|
|
|
Hi,
for each entry in the list, you must locate or create the items in the listview.
Here is the logic, with an example:
adding "Dir1/SubDir3/SubDir4/Subdir5/"
is Dir1 in the top level of the listview? yes, since you already did some entries.
is SubDir3 in the Dir1 level of the listview? no, so create it
is SubDir4 in the Dir1/SubDir3 level? no, so create it
etc.
Classes you will need include the System.IO.Path class to get path parts (alternatively you could use string.Split)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanky for your answer
but do you really write "listview"?
i guess you/i mean a treeview...
could you please give a piece of code
because i have some trouble finding the node where i have to add the new node
|
|
|
|
|
Hi,
I'm making an application which is supposed to be able to print sales statistics.
Any ideas on how to display the results from the query?
Ideally, the results shouldn't even be displayed in the application itself, only when the PrintPreviewDialog component is activated.
I could just input the results into a DataGridView but that doesn't look to good and I need to have the total sum of each column at the bottom of the column. I was thinking of exporting it to Excel but there must be a smoother way.
Any ideas?
All the best
|
|
|
|
|
If it is just for sake of prepare reports like thing, you can use SSRS.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
The thing is, I need to do it through the application, because the person using it will only be able to use the app, and not the DB.
|
|
|
|
|
If you have VS 2005 Professional, then Crystal Reports is part of that development enviornment. You would build the report using Crystal and have your VB invoke the Crystal report.
Or am I missing something? ![Confused | :confused:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
I am using VS2008 Express verision.
|
|
|
|
|
I believe that version of Visual Studio does not have Crystal bundled with it; so you can't use that option. Bummer. You may want to investigate XSLT as a reporting option. You could write your report data out as an XML file and use XSLT to make it pretty for the user.
Unfortunately, I have no experience with XSLT. At my previous company I saw one of the other developers use it in a prototype. Check out the technology.
Another option would be to create Excel documents from your VB App.
Instantiate EXCEL like this, Dim ExcelApp As New Excel.Application and manipulate the Cells with loops around your result set. Not easy, but it would work. ![Wink | ;)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_wink.gif)
|
|
|
|
|
Yeah, that was my next thought, but I want to avoid using excel for this one.
|
|
|
|
|
Hi,
I have a DataGridView control containing several columns one of which is a CheckBoxColumn. Clicking any of the CheckBoxes in this column fires the CellContentClick event which perfoms a task using the value of the clicked CheckBox. However, the value of the CheckBox doesn't seem to update until the cell loses focus, which is a problem for the task I am trying to achieve.
Anybody help me on this one? Thanks.
EDIT : Sorted it I think using the CommitEdit method of the grid.
modified on Wednesday, August 5, 2009 7:46 AM
|
|
|
|
|
Perhaps you can move the task from the CellContentClick event to the DataGrid's MouseUp event ?
Determine which cell has been clicked there, and because MouseUp happens after the rest, the CheckBox value should be resolved and ready for you to use.
My advice is free, and you may get what you paid for.
|
|
|
|
|
In the CellContentClick event, you will get the updated value in the EditedFormattedValue property of the cell and not in the Value property.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Great, just what I was looking for - thanks ![Big Grin | :-D](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
For my project, I have setup a small domain, and arranged a LAN connection.
From my domain, when I connect with my Sqlserver 2008 remotely It's connected, no problem.And the application is running good.
But when I run the program, out of domain not in LAN, it's not connecting with my sql server and showing the error,
"A network-related or instance-specific error occurred while establishing a connection to sql server......(provider; Named pipes provider, error: 40- could not open a connection to sql server).
Any ideas to fix this problem ?
Thanks...![Thumbs Up | :thumbsup:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/thumbs_up.gif)
|
|
|
|
|
What connection string do you use?
My first thought would be your trying to log in to the sql-server using windows-authentication, try providing a login / pass (usually sa / <set during="" installation=""> works)
|
|
|
|
|
Iam using the followings as connection string
Dim ConStr As String = "Data Source=1.1.1.1; initial Catalog=Employee_Master; User Id=Codeproject; Password=xxxxxxxx"
It's cnnecting under LAN, but not with remote machines.
Thanks
|
|
|
|
|
Sounds like an sql-server issue, from what I can remember you have to specifically allow remote connections to the sql-server.
Maybe better to ask this in the General database[^] forum
|
|
|
|
|
Hi,
I have a console application that gathers order data, and creates and sends email messages to sales people.
I run the application in a scheduled task, and the smtp credentials are simply hard coded:
Dim smtp As New System.Net.Mail.SmtpClient("MySMTPServer.MyDomain.com")
smtp.Credentials = New System.Net.NetworkCredential("MyAccount", "MyPassword", "MyDomain")
I run the job under my own account (with power-user rights), because I have no administrator rights to the domain.
What I am thinking about is, that hard coded credentials are ofcourse not ideal to say the least.
My question is, would it be possible to somehow pass the credentials with which the scheduled task is run, to the application?
Any insights appreciated,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I don't have a problem with the idea of hard coded credentials, after all it is a service that is making the call. I have a problem with the being YOUR creds, you should have a service account set up to run these services with the permissions appropriate to the service.
What happens when your 30/90 days are up and you have to change you password (you do have a policy that requires password changes )
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The bad news is that we don't have such a policy, the good news is that I don't make the policy.
You have a good point there actually (about the credentials), and as a solution it is much simpler, than the line of thought I found myself stranded upon.
Thanks !
My advice is free, and you may get what you paid for.
|
|
|
|
|
We have a number of accounts set up specifically for different server jobs from SSIS to reporting and some WCF services, this is over and above the accounts that support the sa in each server.
We do have such a policy, even on the servers and their accounts, thakn God I don't have anything to do with it. The have scripts that change the passwords on all the 1000+ servers, including oracle, sql server, sybase and a couple of other breeds. You should see the chaos when they forget to include a new server in the script.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: thank God I don't have anything to do with it.
I am with you on that one.
Mycroft Holmes wrote: We have a number of accounts set up specifically for different server jobs
We are just a small subsidiary company, so I only need to take care of a relatively small amount of jobs that are specific to just us. Though I am sure that our HQ employs a setup similar to what you describe.
I'll be in contact with them about getting a service account like you suggested.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi,
Im trying to make a robot player for a game im playing
so far i have been using a program called JoyTokey which transfers joystick strokes to mouse or keyboard events.
1) i tryed using sendkeys when the window is focused
But i get an error: "The specific module could not be found"
2) i tryed using Sendmessage and no affect,
3) when i right click the application on task manager and click "Go To Process"
i get nothing, and i cant find it in the processes in task manager manualy either.
4) when i try hwnd on it i get a number but dont know what to do with it.
any idea how can i solve the problem ?
if i knew how the program JoyToKey works...
thanks.
|
|
|
|