|
Apart from the first solution, you can also try
string temp=@"abc""efg";
My signature "sucks" today
|
|
|
|
|
It should be
string temp=@"abc"efg";
|
|
|
|
|
Give it a try - it won't compile.
My signature "sucks" today
|
|
|
|
|
|
Hi I'm new to OOP so having lots of trouble trying to do simple things. I have an Excel file that has data in one of its sheets and I want to to copy 2 (or more) columns and 400 rows of that data into an Array which will reside in a C Sharp programme.
I've built individual Arrays for the 2 columns and have also managed to read the Excel file but I can't seem to get them to populate my Array. I can read Text files as well but I can't seem to able to put them in an Array especially if its multidimensional and has not string and double
any thoughts would be much appreciated.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
public static void Main()
{
string [] Pat = new string[400];
double[] Data = new double[400];
//int contents = 0;
string[] range = new string[6];
Excel._Application app = new Excel.Application();
Excel.Workbook small1 = app.Workbooks.Open(@"C:\Users\Worc\Desktop\small.xls");
Excel.Worksheet sheet1 = Excel.Worksheets.Equals(small1.Worksheets[1]);
Excel.Range r = sheet1.Columns;
Excel.Range r = sheet1.get_Range("B2:B400");
//for(int i = 0; i < sheet1.Range; i++)
//{
//
//}
Console.WriteLine("Value, {r}" , r);
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
hi
|
|
|
|
|
I would start with the button2_click code from
http://support.microsoft.com/kb/302096[^]
but replace
valueString = String.Concat(valueString,
saRet[rowCounter, colCounter].ToString() + ", ");
with something like
s[rowCounter, colCounter] = colCounter].ToString();
where s is defined as
string[,] s = new string[xx,yy];
obviously you'll have to pick some values large enough for xx and yy - since you can get the size eof the array in iRows, iCols, you can use those values to dynamically allocate a large enough array
|
|
|
|
|
Try something like:
int index = 0;
foreach (Excel.Range rc in r.Cells)
{
array[index] = rc.Cells.Value;
index++;
}
[edit]
There's probably a more straightforward version of this (like Garth's suggestion) but I'm sure you get the idea.
[/edit]
It's time for a new signature.
|
|
|
|
|
Hi.........
Please help me to solve my problem.
I have developed one software in VS2008. It is being installed at client site. The problem I encounter is regarding crystal Report in that project.
All my reports are working properly except one. This One is running properly on Windows7 but not on Windows XP. It gives an error as "Unhandled Exception Occured At Your System." at Runtime. While Debugging it on Windows XP it Shows Error as "Invalid Table Number."
Thanks And Regards
Sanket.Patil
.
|
|
|
|
|
See here or here.
My signature "sucks" today
|
|
|
|
|
Hi Abhinav,
Thanks for the reply.
But The Problem is My Report Works Properly on Windows7 and not on Windows XP. I ahve only one database attached to my machine and copy of this database is also attached to another machine. This means database is same data is also same only when i change OS windows7 to Windows XP Report Throws an exception.
thanks and regards
Sanket.Patil
.
|
|
|
|
|
Try and search for this error on the internet. A lot of posts discuss this error and many of the reasons mentioned are different - so you might find a solution somewhere.
My signature "sucks" today
|
|
|
|
|
Common statement - "Dotnet provides a common object oriented programming model across the languages it support."
One of the languages supported by CLR is 'C'. does the above statement mean that 'C' supports OOPS???
Regards,
NetQuestions
|
|
|
|
|
NetQuestions wrote: One of the languages supported by CLR is 'C'.
I don't think that is true. Managed C++ (aka C++/CLI) is supported but not C.
It's time for a new signature.
|
|
|
|
|
The concern is the managed C++/C, however i think the answer is no.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
NetQuestions wrote: languages supported by CLR is 'C'
Where did you find this? They must have meant C#.
My signature "sucks" today
|
|
|
|
|
NetQuestions wrote: One of the languages supported by CLR is 'C'
Wrong.
Visual Studio, since version 7, can be used to develop .NET applications, as it supports several .NET languages; it also supports building a Win32 application (all versions, up to and including the current version 10), based on a different set of languages; that is where C and C++ come in.
Furthermore managed code can call unmanaged or native code (such as C, assembler, ...), by using P/Invoke. That does not turn those languages into .NET languages; if it did, every language would be "managed".
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Personally I have never worked on any language in Dotnet other than C#. I have not worked on unsafe means also.
Luc, is it possible to call base class library methods like system.console.writeline() using unmanaged code like 'C'?
For it that is true, then 'Console is a class' here and Dotnet allows every language to use and access OOP based api => common object oriented programming model
Can this be a correct interpretation of my statement?
Regards,
NetQuestions
|
|
|
|
|
Hi
I had a string which consists both english and hindi characters. I want to write this in a unicode file, but some junk has been observed in the file. But, if i try to write the same data in utf8 file, it is perfectly written as it is.
what is the error?
How can i solve this?
the code is as follows:
string str1 = "This";
string str2 = "यह";
string str3 = str1 + "~" + str2;
StreamWriter sw11 = new StreamWriter(File.Open(@"C:\abc.txt", FileMode.Append));
sw11.WriteLine(str3);
sw11.Close();
str3 = Encoding.Unicode.GetString(Encoding.Convert(Encoding.ASCII, Encoding.Unicode, Encoding.ASCII.GetBytes(str1))) + Encoding.Unicode.GetString(Encoding.Convert(Encoding.ASCII, Encoding.Unicode, Encoding.ASCII.GetBytes("~"))) + Encoding.Unicode.GetString(Encoding.Convert(Encoding.UTF8, Encoding.Unicode, Encoding.UTF8.GetBytes(str2)));
StreamWriter sw12 = new StreamWriter(File.Open(@"C:\abcd.txt", FileMode.Append));
sw12.WriteLine(str3);
sw12.Close();
|
|
|
|
|
|
it is all in the documentation[^], as usual.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I need to display multiple images from a folder by using four image boxes.
The pictures should display according to change. I was put "FileSystemWatcher" to identify the file change and display images according to that. but when execution it does't go inside the "public void OnChanged" function.
but no image will display.
does anyone know how to solve this issue. or any other method for display latest four images from a folder..
Thank you.
This is my code
public partial class Form1 : Form<br />
{<br />
FileSystemWatcher watcher = new FileSystemWatcher();<br />
<br />
public Form1()<br />
{<br />
<br />
InitializeComponent();<br />
<br />
watcher.Path = @"f:\My FYP\FYP_Update 2.1\New_Traffic_Pics";<br />
watcher.Created += new FileSystemEventHandler(OnChanged);<br />
LoadLatestImage();<br />
<br />
}<br />
<br />
public void LoadLatestImage()<br />
{<br />
<br />
<br />
<br />
watcher.NotifyFilter = NotifyFilters.LastWrite;<br />
<br />
watcher.Filter = "*.jpg";<br />
<br />
<br />
}<br />
<br />
public void OnChanged(object source, FileSystemEventArgs e)<br />
{<br />
pictureBox1.ImageLocation = e.FullPath;<br />
}<br />
<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
private void pictureBox1_Click(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
private void timer1_Tick(object sender, EventArgs e)<br />
{<br />
LoadLatestImage();<br />
}<br />
<br />
<br />
}
|
|
|
|
|
I agree.
Watch out for EnableRaisingEvents.
And please use PRE tags, not CODE tags, to preserve formatting when posting code snippets. It is in the guidelines.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
You might want to review this article series regarding FileSystemWatcher.
FileSystemWatcher - Pure Chaos (Part 1 of 2)[^]
FileSystemWatcher - Pure Chaos (Part 2 of 2)[^]
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi everyone
I have a question about creating a click event for a class. Thing is I have created a UserControl which takes images and arranges them dynamically given certain circumstances. This control uses a list of 'Viewports' (basically rectangles which carry an image). I would like to create an event for this Class 'Viewport'. Currently i use the click event of UserControl and loop through the list, checking the regions of these viewports. I thought I could do better than this and give each port it's own event without having to loop. Is this possible? I was thinking in the direction of an API, but all ideas are welcome.
Thanks
Steven Solberg
|
|
|
|
|
Steven Solberg wrote: This control uses a list of 'Viewports' (basically rectangles which carry an image).
Could each of them be a UserControl?
|
|
|
|