|
By the way steve,
Here's another little trick,
If you deploy the launcher you made into the temp folder, the next time the user cleans the temp folder it will be deleted.
|
|
|
|
|
How to setting datagrid properties to retieve data from MSSQL database?
|
|
|
|
|
|
i have seen the code.but it is for asp..Actually i'm using VB6.0 connected with MSSQL Database server.How to set up data grid control and retrieve data from the database.thank you.
|
|
|
|
|
|
Hey,
Using the FolderBrowserDialog i select a folder. From here i want to recurse through this folder and add it (and all its subfolders and files) to an XML file so it can then populate a treeeview.
I am having trouble recursing the Folders and files in to the correct xml nodes during the recursion.
I am using structure:
<category>
<name></name>
<file>
<name></name>
<path></path>
</file>
</category>
And for Sub Folders
<category>
<name></name>
<file>
<name></name>
<path></path>
</file>
<category>
<name></name>
<file>
<name></name>
<path></path>
</file>
</category>
</category>
Any help or tip or links would be very helpful
thanks for your time
Chris
|
|
|
|
|
hi, This is a particularly easy problem to solve as a small recursive function will do all the work for you.
The best way I could think to do this was to derive a class from XmlTextWriter - in my case I named it XmlFileSystemWriter. The purpose here is to add a method that will write out a directory recursively, to the Xml, in the format you want.
Here's what I ended up with:
using System;
using System.IO;
using System.Xml;
using System.Text;
namespace TestApp
{
public class XmlFileSystemWriter : XmlTextWriter
{
public XmlFileSystemWriter(TextWriter w) : base(w)
{
}
public XmlFileSystemWriter(string fileName, Encoding encoding) : base(fileName, encoding)
{
}
public XmlFileSystemWriter(Stream stream, Encoding encoding) : base(stream, encoding)
{
}
public void WriteFileSystemInfo(DirectoryInfo baseDir)
{
this.WriteStartElement("fileSystemInfo");
this.WriteDirectory(baseDir);
this.WriteEndElement();
}
private void WriteFile(FileInfo info)
{
this.WriteStartElement("file");
this.WriteElementString("name",info.Name);
this.WriteElementString("path",info.FullName);
this.WriteEndElement();
}
private void WriteDirectory(DirectoryInfo info)
{
this.WriteStartElement("category");
this.WriteElementString("name",info.Name);
foreach(DirectoryInfo subDir in info.GetDirectories())
WriteDirectory(subDir);
foreach(FileInfo file in info.GetFiles())
WriteFile(file);
this.WriteEndElement();
}
}
}
Usage should be simple enough to work out:
<br />
DirectoryInfo di = new DirectoryInfo("C:\\yourdirectory");<br />
XmlFileSystemWriter w = new XmlFileSystemWriter(Console.Out);
w.Formatting = Formatting.Indent;<br />
w.WriteFileSystemInfo(di);<br />
I have provided all three constructors for you so you can use a TextWriter, write to a specified file, or to a specified Stream - have a play with the above and post back if you have any problems.
|
|
|
|
|
Hey Jamie,
Your help proved real usefull, I have got it working writing dir structure to xml. I changed my schema though to:
<category label="Directory Name">
<file>
<name>Test1</name>
<path>C:\Test1</path>
<file>
<category label="Sub Category">
<file>
<name>Test2</name>
<path>C:\Test2</path>
<file>
</category>
</category>
The only problems i seem to be having now is recursing through the XML document to add nodes to tree view so the category attributes are the Parent and child tree nodes and the <file> <name> information is the files within either nodes.
So for example from the above XML
Directory Name
- Sub Category
- Test2
- Test1
Any help would also be appreciated on this matter, thanks very much for your effort so far.
Kind regards
Chris
|
|
|
|
|
Solved my problem, thanks for the help
chris
|
|
|
|
|
Hi All,
I am abt to trying filling PDF forms using VB.NET in DOT NET.
Would you please anybody let me know Saving ,Deleting ,Editing PDF forms in DOT NET if anybody has contributed on this.Please send me ur suggestion ASAP
Regards
Anurag
Anurag
|
|
|
|
|
There are a number of components you can buy in to do this, some of the vendors even advertise on CodeProject, so it shouldn't be too hard to search for things to do this.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Can you get something deep besides this...Getting Components from third party and build ur own...
Regards
Anurag
|
|
|
|
|
|
But if you wanted to build your own, the documentation and SDK's to support what you want to do can be found at http://developer.adobe.com, for the nominal fee of $195.00 US, of course. Other than that, you'll have to search the Open Source sites, like SourceForge, for similar projects.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I want to develop one application in VB.NET (ASP.NET Web Application). Now I want to use some of the functions which are in my DLL that I developed in C++.
Plz any one can guid me how to include the DLL or what is the code to include DLL into VB.NET ?
Pls help me dear ?
Regards
Mike
|
|
|
|
|
|
couldn't you just add a reference to the dll and then use it from there??
|
|
|
|
|
but there is no dll file in the source, am i missing something? all i see is a .cs which is a text based file.....i am a little ignorant to the subject of dll files, so if i am missing something please let me know, but i dont see a dll file to reference too. i also do not have a c# compiler in my vs.net
|
|
|
|
|
the C# compiler is freely available. It comes with the .NET SDK which was quite probably installed with VS - if not you should be able to find it on the Microsoft web site. Look for a file on your system called csc.exe. If there is only one cs file it is quite easy to compile it into an assembly (DLLs are properly called assemblies in .NET)
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
the compile was successful, later tonight i will tell yall if it works =)
|
|
|
|
|
Hi,
I am trying to use the propertygrid as a user interface. I have currently only two issues left. The first one is how can I store the value of a listbox in a property. I am using the propertybag as described in "bending the propertygrid". As far as I can see I can only store the text of the listbox. I need both a the one is the key in my database and the other the sensible text.
Secondly I have a couple of multiline textboxes, for instance for some additional information about a person. As the propertygrid is only single line I was thinking of using the description box to display the full text. For this I would need to be able to change the description and set this equal to the information that was just entered at run time. Is this possible or are there some other solutions to tackle this problem?
Any help would be appreciated
Cheers
David J
|
|
|
|
|
Dim PKCalls As DataTable = DirectCast(Session("GetPKCallS"), DataTable)
PKCalls = New DataTable()
Dim sc As New PK.BusinessLogicLayer.Consumer()
Dim tDay As Integer
Dim tCall As Integer
Dim DD As String
Dim CallActivity As String
tDay = Integer.Parse(txtPast.Text)
tCall = Integer.Parse(txtCall.Text)
DD = Today.AddDays(-tDay)
CallActivity = Today.AddDays(-tCall)
PKCalls = sc.GetPKCallSheet(txtGender.Text, txtRace.Text, lblUpDOB.Text, lblLowDOB.Text, ddlSite.SelectedItem.Value, DD, CallActivity)
Session("GetPKCallS") = PKCalls
Dim cr As New ReportDocument()
Dim cx As New ExportOptions()
cr.Load("path to Crystal Report file")
cr.SetDataSource(Session("GetPKCallS"))
Dim N As String
N = "CallSheets" & Session("userOffice") & Now & ".rpt.PDF"
N = Replace(N, Chr(32), "")
N = Replace(N, ":", "")
N = Replace(N, "/", "")
cr.SaveAs("filepath to destination" & N, ReportFileFormat.VSNetFileFormat)
***********************************
*Given the above code, I am able to send this file to where I want it. When
I try to open the file I get this:
"Adobe Reader could not open 'Name.rpt.PDF' because it is either not a supported file type or because the file has been corrupted"
*************************************
Please help, any examples are much appreciated.
Thank you.
|
|
|
|
|
What CrystalReports is writing to your file is not a valid .PDF format. The version of CrystalReports that comes with Visual Studio, apparently, doesn't support .PDF. It looks like you'll have to upgrade to the full version of CR from BusinessObjects.com.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can anybody tell me how I can append to a string using a ‘For Each’ loop?
Here is my loop:
For Each File In Dir.GetFiles("*.lnk")<br />
...<br />
TheString = "Some Data" & Variable<br />
Next<br />
<br />
FinalString =
In the example each loop changes ‘Variable’ and I want to, on the first loop, set ‘FinalString’ equal to ‘TheString’ and then on each loop thereafter I want to append ‘TheString’ to ‘FinalString’
Thanks
Brad
|
|
|
|
|
Use a StringBuilder . You'll find it in the System.Text namespace.
Example using StringBuilder.Append[^]
1. Create the StringBuilder
2. Start the Loop
3. Append to the StringBuilder
4. Repeat 3 as necessary
5. Call ToString() on the StringBuilder to get at the string .
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|