|
I'm actually using primitive types right now to try and get some of the details worked out.
|
|
|
|
|
Just for kicks, I tried some other objects that I know to be serializable with no luck. Does any one have any other ideas?
|
|
|
|
|
When I use the Visual Studio 2005 DataSource Wizard to connect to an Access database, it seems that it hard-codes the connection string for the database file, but I can't find where.
How can I allow the user to dynamically choose a different database file at runtime, but still use the data-bound Grid View control?
Thanks
|
|
|
|
|
Background:
I need to read in 3 text files. Each file has it's own format. I decided to code a class for each type. Each class impliments some common methods:
getItem()
getDescription(item)
getCount()
In addition each class contains some items that are more specific to the data in that file. I originally had specified the name of the file to be read in the constructor. The constructor would then load the file (and it's associated data) into arrays then close the file. The instance would look like this...
fileReader1 fr1 = new fileReader1(sFileName);
It was then requested that I validate my input files. This is where my question lies..
What is the best approach for this functionality? Bear in mind I need to not process anything if the file is not valid. I am currently working on a 3 tier design (GUI, Logic, Data). The readers are called from the Logic layer. I have mulled the following:
#1 Move the ability to read the file from the constructor to a public method. Code a new method called 'validated()' that would return TRUE if the file was valid and then call the read method (this would be done from the Logic layer) if validated returns TRUE
#2 Continute to read in the file via the constructor, but only read the file if it is valid (via private validate method). If the file is not valid fire a 'not valid event' and catch it in my GUI.
#3 Create a seperate class called 'Validator' that I pass in the file to validate and the type. If this returns TRUE then continue, otherwise dont'
#4 Let the constructor validate the file. Set a bool variable in my reader class and expose it as a public property. If file is valid set variable to TRUE and call public read method.
I am interested in the best way, the 'professional' way to impliment this. Thanks in advance for your thoughts/comments.
www.lovethosetrains.com
|
|
|
|
|
Hi,
Iam Connecting to Excel 2003.
I used the following connecton:
string str = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\projects\empdata.xls;Extended Properties=Excel 11.0;";
OleDbConnection con = new OleDbConnection(str);
con.Open();
Iam getting this exception:Could not find installable ISAM
Please help me.
Thanks in advance
|
|
|
|
|
Hi,
try
string str = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\projects\empdata.xls;Extended Properties=""Excel 8.0"";";
I use Office 2003, too, but only Excel 8.0 works for me.
|
|
|
|
|
Hi,
Thank you very much.It is working.
|
|
|
|
|
hi
this is my code in vs 2005 :
//Resource_1.exe is .net v2.0 file
string fullName = this.GetResourceFullName("Resource_1.exe");
Stream stream = current.GetManifestResourceStream(fullName);
byte[] bytes = new byte[stream.Length];
stream.Read(bytes, 0, (int)stream.Length);
Assembly a = Assembly.Load(bytes);
MethodInfo entryPoint = a.EntryPoint;
entryPoint.Invoke(null, new object[] { new string[0] });//error show me for second argumant of this function
private string GetResourceFullName(string resName)
{
string fullName = null;
foreach (string str in this.current.GetManifestResourceNames())
{
if (str.EndsWith(resName))
{
fullName = str;
break;
}
}
return fullName;
}
when i compile my app and click the button to run these code an error shown me that "parameter count mismacth"
what is my problem and how to solve it ?
|
|
|
|
|
Imagine the following was the commandline argument.
Path=d:\f\Backup\"Wolf's Documents"\"Visual Studio 2005"\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.dll
I already took care of the spaces in their with the quotes, but i tried everything i could think of to deal with the apostrophes in "Wolf's Documents" including one sites suggestion of using a '\' infront of them which didn't seem to have an affect.
|
|
|
|
|
1. Is there any reason this can't be Path="d:\f\Backup\Wolf's Documents\Visual Studio 2005\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.dll" so that one set of quotation marks takes care of the whole situation?
2. So, what's the problem?
--
I've killed again, haven't I?
|
|
|
|
|
|
I want to retrieve the icon used to represent a removable or local hard disk.
I know I can use SHGetFileInfo to get the icon if the disk exists, but what if the disk doesn't?
Basically I want to create a tree structure representing a device that has a removable disk and a local disk. These devices will exist on a virtual device that I am representing.
Is there a way to retrieve an icon for a Device that doesn't exist? i.e. can I specify something that denotes to SHGetFileInfo that I want a device's icon for a device's type that I specify?
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
Hi,
I'm calling a web service from my app and its execution lasts a few minutes, normally. I would like to leave it executing without making my app wait until it finishes. How can I do this? Some type of thread or something?
Thanx for any help!
|
|
|
|
|
Here's a simple snipet:
using System.Threading;
...
public void myProc( object stateobject )
{
MessageBox.Show( "This is a thread." );
}
private void button1_Click(object sender, System.EventArgs e)
{
ThreadPool.QueueUserWorkItem( new WaitCallback( myProc ) );
}
|
|
|
|
|
Thank you!
|
|
|
|
|
Hi.
I like PieDoes anyone know of any cheap, or free VC# skinning programs?
Thanks
Hengy
I like Pie
|
|
|
|
|
Hey.
Can anyone help me with this.
I have an object, that can grow bigger or smaller.
I need to save it in a file after I encrypt it.
The problem -> How can I clear the file before saving new stuff in it? if I won't clear it, it will write in the start 1 object, then I will have the same object PLUS the new object, then I will have the 2 last object PLUS the new one.... etc...
So... How can I do it?
Thanks...
NaNg.
|
|
|
|
|
Well the FileStream constructor goes like this:
FileStream( string path,FileMode mode );
Now, FileMode is an enum with member names:
Append, Create, CreateNew, Open, OpenOrCreate and Truncate.
If you use FileMode.Create it will overwrite the old file or create a new one if the file doesn't exist.
Hope this helps.
|
|
|
|
|
|
Hi!
I'vw been having some odd problems with connecting elements in Dundas diagram. I have an Element with 3 ConnectionPoints ( on is an input, and two ara outputs ) and when I try to connect a second Element's input to one of the outputs it always connects to the same ConnectionPoint no mater which I specify in the code. Like:
ElementFunctionality.ConnectElements( myConnector , TheOtherPoint , myElement.ConnectionPoints[ "Yes" ] );
//and
ElementFunctionality.ConnectElements( myConnector , TheOtherPoint , myElement.ConnectionPoints[ "No" ] );
will both connect to the "Yes" ConnectionPoint of the elment. I've even tried connecting manualy without using the ConnectElements function. I'm realy out of ideas.
Can someone help? Oh, and here is a screenshot.
|
|
|
|
|
Try support@dundas.com
Regards,
Nish
|
|
|
|
|
Hi
I have been trying to get my code working for days now, but I have run out of ideas of what could be wrong.
My problem is that I have a program where I want to save a file path from an openfiledialog into a XML document. It sounds pretty simple, but I keep getting an XML error, saying that my XML file does not exist :-S Even though it is the correct path.
I was wondering if anyone had a piece of code, which does the above-mentioned? That way I may be able to find a solution to my problem.
//Nick
|
|
|
|
|
It would help if you posted a code fragment.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
public class ClassFunctions : FormMain
{
private string strXMLLocation = @"..\..\WallpaperDatabase.xml";
public string fxGetFileName()
{
string strFileName = "";
this.openFileDialog1.Multiselect = false;
this.openFileDialog1.ShowDialog();
if (File.Exists(openFileDialog1.FileName))
{
strFileName = openFileDialog1.FileName;
}
return strFileName;
}
public string fxGetString()
{
string strFileName = "";
this.openFileDialog1.Multiselect = false;
this.openFileDialog1.ShowDialog();
if(File.Exists(openFileDialog1.FileName))
{
strFileName = this.openFileDialog1.FileName.ToString();
}
this.openFileDialog1.Dispose();
return strFileName;
}
public void fxAddPicture()
{
string strFilePath = fxGetFileName();
string insertXML;
XmlDocument xdoc = null;
XmlTextReader xreader = null;
XmlDocumentFragment xdocFrag = null;
try
{
xdoc = new XmlDocument();
xreader = new XmlTextReader(strXMLLocation);
xreader.Read();
xdoc.Load(xreader);
xreader.Close();
insertXML = "<Wallpaper><FileName>" + "test" + "</FileName><FilePath>" + strFilePath + "</FilePath></Wallpaper>";
xdocFrag = xdoc.CreateDocumentFragment();
xdocFrag.InnerXml = insertXML;
xdoc.DocumentElement.AppendChild(xdocFrag);
xdoc.Save(strXMLLocation);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
Here are the two functions within my class which are supposed to do the job J
//Nick
|
|
|
|
|
Perhaps you should try
private string strXMLLocation = Application.StartupPath + @"..\..\WallpaperDatabase.xml";
|
|
|
|