|
Could you please give me the start up the code!
Thanks for your time.
|
|
|
|
|
Something like this should get you stated if you fix the two or three errors in it
namespace cvsreadapp
{
class CVSreader
{
public static bool ReadFile(string sFileName, out string[][] saJaggedArray)
{
bool bReturnValue = false;
try
{
string[] sFile;
int i=0;
StreamReader srFileIO = null;
FileStream fsFileIO = null;
fsFileIO = new FileStream(sFileName, FileMode.Open, FileAccess.Read);
srFileIO = new StreamReader(fsFileIO);
sFile = srFileIO.ReadToEnd().Split('\n');
saJaggedArray = new string[sFile.Length][];
foreach (string x in sFile)
{
saJaggedArray[i] = new string[3];
saJaggedArray[i] = x.Split(',');
}
srFileIO.Close();
fsFileIO.Close();
bReturnValue = true;
}
catch
{
bReturnValue = false;
}
return bReturnValue;
}
}
class MyApp
{
static void main(string[] args)
{
string[][] jaggedarray;
if (!CVSreader.ReadFile("mycvsfile.cvs", out jaggedarray))
{
Console.WriteLine("Error reading CVS file");
}
foreach (string[] i in jaggedarray)
{
foreach (string j in i)
{
Console.Write(string.Concat(i," "));
}
Console.Write('\n');
}
}
}
}
|
|
|
|
|
hint on the errors:
(I did this so you'd learn; cause this sounded like a homework assignment)
Error 1: check main to see if it is "correct" right
Error 2: look into how an "out" var works (IE does it have to be assigned to?)
Error 3: bReturnValue might be setup "incorrectly" and cause problems in the function
|
|
|
|
|
Hi everybody:
I posted this on Visual Studio forum, but it seems to be frozen a bit, so I move it here.
I have written (or rather I started writing) a control which I want to act as an container in design-mode. After some googling I find out how to preform that. But... there was an error.
After about hour spent on doing random operations in VS 2005 PE, I find out how to effectively recreate the error. When I add some child controls to my control, then I can run App and everything is OK. But if I then recompile the control's DLL, and go back to the App's designer, then all child controls disappear, regardless whether the line "myControl.Controls.Add(childControl); " is still present in the generated code...
Please help...
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
I have one large SQL table with over 50 columns and 300,000 rows. I want to read each row in this table, perform data validation, and write this data to several different tables in different tables in the same database. I want to be able to reference each column by name and enforce strong data typing. I need an overview of how to do this and, if possible some sample code.
Joseph Stanish
|
|
|
|
|
Hi,
I'm currently in the process of an Utility that is similar to the Query Analyzer.
I have assigned the Database name in app.config file and it works fine.
But now the problem is,I have to extract all the Databases from the LocalNetwork in the Listbox,
and i Require to change the Database name in the App.Config File at run time
according to the database that i select from the Listbox.
And here's the app.config file code..
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="SQLQueryAnalyzer" value="Data Source=(local);Integrated Security=True;User ID=;Password=;Initial Catalog=Northwind" />
</appSettings>
</configuration>
hi,
Please anyone help me in finding out the solution.
BhuMan
|
|
|
|
|
|
Hi,
If you look at his first attempted post, you'll see that he had a problem with getting his config file in the post. Probably due to the xml tags confusing the html. He fixed it in the re-post. It would have been nice if he had deleted the botched attempt, but some people can't seem to be bothered to clean up their own messes. Maybe he thought his mother would clean up after him.
Best regards,
BDF
|
|
|
|
|
You cannot modify the contents of App.config using ConfigurationManager.AppSettings . You can, however, write to it as you would with a regular XML file.
I recommend you store these settings not in App.config but in a separate XML file that you can safely read from and write to.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
i have a txtName where i write any name, and all the ather controle are enable=false
after the user enter the value in txtName he press enter, tab what ever
the program should enable the groupbox and chage the focus to the first controle in it.
How i can do it?
Thanks a lot
Assaf
|
|
|
|
|
Handle KeyDown event of txtName:
private void txtName_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab )
{
groupBox.Enabled = true;
theFirstControl.Focus();
}
}
By the way, you do not have to set Enabled property for each control in the Group Box, if the groupBox.Enabled is set to false.
Hope this will help
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
how to add crystal report
|
|
|
|
|
This is practically the same question as the one you posted just one minute previously.
|
|
|
|
|
The best approach is
1. Write down on paper the question you require answering.
2. Turn off your computer, unplug it and pack it away out of reach.
3. Give the paper to someone with enough grey matter to provide a verbal answer for you.
4. Don't go anywhere near a computer again.
Go to 4.
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days
|
|
|
|
|
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
how to add and connect crystal report 8.5 verssion c#.net 2005;)
|
|
|
|
|
How many times have you been told already not to use a subject line of "C#" when you are posting in the C# forum - It is redundant.
Please read this article[^]
|
|
|
|
|
I have the feeling, that he is doing it for fun.
He loves too see us going crazy!
All the best,
Martin
|
|
|
|
|
Martin# wrote: I have the feeling, that he is doing it for fun.
You underestimate human stupidity.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
Hi All,
I have to use two sub reports in a main report.
But, I am getting the error, Subreport could not be shown.
There are no articles or blogs for this multiple reports in main report.
Can anybody help me on this????
-Saran
|
|
|
|
|
Do you have any c# code that would export registry file? and save it as text format?
pls help...
I know how to manually export registry file thru registry editor. But how do we do it programmatically using c#?
Thanks
|
|
|
|
|
|
Use Microsoft.Win32 namespace. You can find there a RegistryKey class:
RegistryKey root = Registry.LocalMachine;
Then create a recursive method which would scan the whole registry, using GetSubKeys, GetValueNames and GetValue methods. The recurse would hang on the iteration through GetSubKeys method.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Error: The given path's format is not supported.
I am trying to upload from a page to the webserver and I got this error.
the code is just this
public void Upload_ServerClick(object sender, System.EventArgs e)
{
string baseLocation = "ftp://layer3media.com/DataGroup/Test/";
string status = "";
Label1.Visible=true;
foreach(System.Web.UI.HtmlControls.HtmlInputFile HIF in hif)
{
string fn = System.IO.Path.GetFileName(HIF.PostedFile.FileName);
HIF.PostedFile.SaveAs(baseLocation + fn);
filesUploaded++;
status += fn + "
";
}
}
}
Pravin
|
|
|
|
|
pavya_Cool wrote: HIF.PostedFile.SaveAs(baseLocation + fn);
will not work when baseLocation is string baseLocation = "ftp://layer3media.com/DataGroup/Test/";
You may need to save the file to a temporary location and use a FTP Client API to transfer it to an appropriate FTP folder.
|
|
|
|