|
Hi,
I have some Form and on it some UserControl that i wrote.
I need to use a lot of string on the userControl ==> so i will put all the string on the resources file of the Form.
I define new static resources variable on the Form class in this way
static public System.ComponentModel.ComponentResourceManager resources
and my plan is to get those string by using this resources variable.
But ... when i insert new string to the resource file and i close the IDE( after save the solution ) and open it again ==> the string is not there any more ((!)).
How to save the strings in some other way ?
Thanks for any help.
|
|
|
|
|
Hi, i already know how to get the lan ip within my c# app, but how do i get the wan ip?
thx in advance!
|
|
|
|
|
|
|
how to create array of string??
I ve to store path of file in array..
I use
string stotefilename[]= new string[50];
is it correct??
if anyone knows abt the array of string then plz reply
thanks
|
|
|
|
|
string[] stotefilename= new string[50];
However, all the strings in that array will be null until you initialize them.
|
|
|
|
|
string[] storeFileName = new string[50];
|
|
|
|
|
i want to make Photo Thumbnail copy and save it in data base
---
please i want help , i want to make upload to photo
befoar save it in data base i want to make copy from this photo and resize it to make Thumbnail image and then save it in data base
Palestine
|
|
|
|
|
|
Hello,
I have displayed a report from SQL server 2005 Reporting Service in C# windows form using reportviewer, now I want to code on a button pressing which the report get exported in PDF or JPEG format. Can any one help
Regards,
Farrukh Malik
+92-300-2564099
|
|
|
|
|
Is reportviewer a type of Windows Forms control? If so, you can render that to bitmap using Control.DrawToBitmap[^] method.
|
|
|
|
|
You can do this using the web services exposed by SQL Reporting Services.
Paul
|
|
|
|
|
ca you explain it a little
Regards,
Farrukh Malik
+92-300-2564099
|
|
|
|
|
Have a look at this article[^].
The sample code is in VB.NET, but it explains the concept of using the SSRS web service to generate a report programatically in PDF/Excel format.
Paul
|
|
|
|
|
I am trying to find all the classes in .net framework that has a particulart attribute. Is that possible?
I know it can be done but i just need a starting point if someone can help me out.
Also, Is there a way to list all the classes in .NET Framework?
Thanks.
|
|
|
|
|
Sure. You'll need to load all assemblies in the .NET framework using Assembly.LoadFile , then call GetTypes on the resulting assemblies. For each type in each assembly, call GetCustomAttributes method.
|
|
|
|
|
Hi,
I have been writing bytes to a file as per requirement.
It works fine when writing to files of type doc and ppt however error occurs when trying to write a file of xls type
It throws an error stating the file is read-only, cannot access......
The sample code is as follows:
FileStream fs;
fs = File.Open(@"C:\Book1.xls", FileMode.Open, FileAccess.Read);
long nBytes=fs.Length - 1;
Byte[] b = new Byte[fs.Length - 1];
fs.Read(b, 0, (int)nBytes);
fs.Close();
fs = null;
FileStream fs1;
fs1 = File.Open(@"C:\Dummy.xls", FileMode.Create, FileAccess.Write,FileShare.ReadWrite);
fs1.Write(b, 0, b.Length);
fs1.Close();
fs1=null;
gauthee
|
|
|
|
|
at which line are you getting the error?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Justin,
There is no error in the code written however when trying to open the new xls file created i get the follwing pop-up:
'Dummy.xls'cannot be accessed. The file may be read-only, or you may be trying to access a read only location. Or, the server the document is stored on may not be responding.
Why is this happening?
Thanks,
gauthee
|
|
|
|
|
If your XSL file is for example 400 bytes long, your read operation will read somewhere between 1 and 399 bytes (both extremes included).
It can never 400 as you tell it to read fs.Length - 1
It is not even certain it will read 399 bytes, as any stream can choose to chunk any way it likes. The only thing you know for sure is that it will return minimum 1 byte (as long end of file has not been reached) and maximum the number you specify.
Either loop the read (you get the number of bytes read in the return value), or use a BinaryReader which offer the possibility to read a fixed number of bytes without any chunking (it will simply do the looping for you).
|
|
|
|
|
Hi All,
I have a menustrip in my project and in this i have some items like File,Edit,Help
and i have set mnemonic for these items with & like(&File,&Edit,&Help) so when i am in design mode
i can see the underscore with all first letters but when i run the project i can't see .
But i want to see it , please tell me how can i do it?
Any help would be appreciated.
thanx.
Praveen Sharma
|
|
|
|
|
Press the alt key to show those. This is standard Windows behavior. If you want to change it, go to Control Panel -> Display -> Appearance -> Effects -> "Hide underlined letters for keyboard navigation until I press the Alt key", and uncheck that option.
|
|
|
|
|
Thank you very much.
Praveen Sharma
|
|
|
|
|
Since I lack a mentor I have to ask these basic structure question here. Good guidance is really appreciated. Please be advised that I am thinking of both Python and C# structure; but generalities are good too:
Classes: What should go into a class and what should stay out?
-I am converting a program to have an OOP structure the program prints out processed results to a file line by line. Should my class for this return the processing results to the main program and then use a function or another class to print the results?
-Is it acceptable to have a class return some result but then call on the same class object to process the next logical step of the process? This seems right to me since built in functions seem to do this.
eg:
Have MyClass read the first line in a file, return it
Have the main print the line
Have the main call MyClass again but have it read the next line in the object
Should I just forget about "functions" and "sub-routines" and throw everything into classes?
TIA,
The shwa guy
|
|
|
|
|
shwaguy wrote:
Classes: What should go into a class and what should stay out?
Everything in C# MUST be in a class.
shwaguy wrote: Should my class for this return the processing results
and
shwaguy wrote: Is it acceptable to have a class return some result but then call on the same class
Classes in C# can not return values, methods (functions) and properties (think externally accessible variable) can.
shwaguy wrote: Should I just forget about "functions" and "sub-routines" and throw everything into classes?
your functions have to be contained in a class
For an example all of these sources do the same thing
namespace myApp
{
class mainclass
{
static void Main(string[] args)
{
My_Function_();
}
public static void My_function_()
{
Console.WriteLine("My \"Function\" was called");
}
}
}
namespace myApp
{
class mainclass
{
static void Main(string[] args)
{
myclass.My_Function_();
}
}
class myclass
{
public static void My_function_()
{
Console.WriteLine("My \"Function\" was called");
}
}
}
namespace myApp
{
class mainclass
{
static void Main(string[] args)
{
anothernamespace.myclass.My_Function_();
}
}
}
namespace anothernamespace
{
class myclass
{
public static void My_function_()
{
Console.WriteLine("My \"Function\" was called");
}
}
}
|
|
|
|