Hi,
I am using the following code to read a file.
DirectoryInfo dir = new DirectoryInfo(@ "C:\");
try
{
if (dir.Exists)
{
FileInfo[] csvfiles = dir.GetFiles("* .csv");
foreach (FileInfo file in csvfiles)
{
...
User Profile
Collapse
-
cathy25 started a topic Could not load the file exception when trying to read a file with StreamReaderin .NETCould not load the file exception when trying to read a file with StreamReader
-
Migrating DTS Packages from SQL server 2000 to SQL server 2005
Hi,
we are planning on migrating our sql from version 2000 to 2005 (I know SQL 2005 is in market from a while). As a part of testing, i have installed sql server 2005 on my development box and able to restore all databases from the production. When it came to DTS packages, I have used SSMS to migrate them by going into Management --> Legacy --> Data Transformation Services --> RC and selected Migrate Wizard. I have gone through the... -
Thanks for your reply.
But, when I try to execute in the way you have mentioned above, it is giving me the following error at the sub procedure.
"An object reference is required for the non static field,method or property uploadreports.p rogram.upload(s tring,string)"
Any idea how to fix it? -
How to call a sub procedure in a console application?
Hi,
I want to use a sub procedure called upload as follows in a console application.
Code:namespace uploadreports { class program { static void Main(string[] args) { public void upload(name1,name2 { //my code } upload(name1,name2); upload(name3,name4); } } }
But, if i try to call it in this way, it is giving error under...Last edited by Frinavale; Jan 22 '09, 05:41 PM. Reason: Moved to C# Answers from ASP.NEt and added [code] tags -
-
for (int i = 1; i <= 15; i++)
{
string firstId = FirstItemId[i].ToString();
string secondId = FirstItemId[i+1].ToString();
if (firstId == secondId)
{
MessageBox.Show ("Duplicate Item exists....,Syst em is resetting it to blank! If you would like to change it, open the form again");
...Leave a comment:
-
Thanks for your reply. But, in my case, I don't have any lists.
we are loading the user input as follows
for(int i=1;i<=15;i++)
{
string FirstItem=ID1.t ext
}
...like this. Then how can I use this in my foreach statment?
TIALeave a comment:
-
How to find the duplicate items in a list?
Hi,
My requirement is to check for duplicate items in a list of 16 strings.They will be entered by users like this...Item1,It em2,Item3....It em16. I need to check for the repeated items if any exists and need to reset it to zero or null.
Could any body point me in a direction to write the logic in C#?
Thanks,
Cathy -
How to open a folder in VS 2005
I am a newbie in using vs 2005. I have a folder which contains some 20 .aspx and 20 .aspx.cs pages and some other css and javascript files with in it. It is a project folder. How can I open this entire folder in VS 2005 without opening each file one by one? -
-
Retrieve a record on itemid
Hi all,
My requirement is to allow users to enter partno. in a text box.
There is a button called 'populate'. whenever the user enters a partno. and hits on populate button, the matching record from the database should show up on the screen. Each field in the databse got corresponding textboxes on the screen.
I have used the following code:
under Button_Click event,
...Code:SqlConnection MyConnection = new SqlConnection(Mysqlconnectionstring);
Last edited by Curtis Rutland; Oct 16 '08, 02:57 PM. Reason: added [CODE] [/CODE] tags, use them when posting code. -
OK! I think these are the new functions in SQL Server 2005.
But, I am using SQL Server 2000.Leave a comment:
-
-
Help in writing SQL query
Hi,
I have a table like this with two fields Field1,Field2.
Field 1 Field 2
00345 Hello world
00456 Hello world
09934 Hello world
78900 New filed
12345 New filed... -
Another way of the same query is
Select Phonenum,max(la stcalled) from Table
group by Phonenum
order by PhonenumLeave a comment:
-
C# variables question
Hi,
Is it possible to declare a variable in On_load event of a page and use the same variable in On_click event (button) of the same page?
If yes, How do we need to declare the variable?
Can any body reply me.
Thanks -
I have also tried by changing the out stream as
MemoryStream outStream = new MemoryStream(AP QPFile.GetHashC ode ());
still it is not updating the xml file.
Please any body give me reply.Leave a comment:
-
How to Update the XML file
Hi,
I am trying to get data from a xml file, and I am trying to update the xml file depending on some condition.
I wrote the following code.
[code=cpp]
MemoryStream inStream = new MemoryStream(MY File.OpenBinary ());
XmlTextReader reader = new XmlTextReader(i nStream);
XmlDocument xd = new XmlDocument();
xd.Load(reader) ;
reader.Close();... -
Thank you very much.
It is working now.
I was missing that logic.
ThanksLeave a comment:
-
I am not getting any error at the code. But I think the logic will be different for my requirement. Please help me finding out the logic.Leave a comment:
No activity results to display
Show More
Leave a comment: