|
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");
}
}
}
|
|
|
|
|
SpacixOne wrote: Everything in C# MUST be in a class.
What about Structures?
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Well, there wasn't a question about a struct... but
A structure can't inherit from a class (and vice versa) and a struct is created then dies when reaching the closing brace. It is a different animal but no it doesn't have to be defined within a class, but if you use it (write or read a member) that HAS to be inside a class...
More C# syntax can be found here http://msdn2.microsoft.com/en-us/library/618ayhy6(vs.80).aspx[^]
|
|
|
|
|
shwaguy wrote: What should go into a class and what should stay out?
In: Students who have an aptitude for the subject and really want to learn.
Out: Students who think the subject is an "easy A" and that "anyone can do it".
|
|
|
|
|
OK,
So the message I seem to be getting is that, anything can be done from anywhere as long as it works. So if it seems write to have MyClass.Function0 return a value and dump that value to a file it is technically OK.
Aside from logical organization is there anything style wise I should know? For instance it would not seem right to have MyClass.Function both return a value and print those same values; I seems right to have a seperate class.function take the return values from MyClass.Function and do the writing. That would allow me to have multiple funcitons access my file writing function and eliminate repeat code.
Is that right?
The shwa guy
|
|
|
|
|
Hi,
my programm reads/writes an xml file. Here is how:
Open file
read
Close file
Open file
write
Close file
Yes,it's necessary that way. My problem is, when I open the Windows Explorer (WinXp sp2) and look into that folder, after some time i get an exception that the file is openend partially by an user.
This happens EVERYTIME at the same codeline: doc.save(myfile) (doc = xmlDocument).
Why is that happening?
Can i prevent that? If not, how can i handle that exception, without Thread.sleep loops?
Please help me!
|
|
|
|
|
You might have left off the <pre></pre> tags and we can't see the code you posted...
|
|
|
|