|
hello everybody,
i have a datatable wich i want it to be attached in an email as excel(.xls)
in order to do that:
1. i'm exporting the datatable into an excel file.
2. i'm saving it in a specific folder.
3. i'm attaching it.
is there any way to directly attach the datatable to an email as excel file directly without exporting and saving or at lest not saving because it's working on a server an i don't want to use its space
kind regards
|
|
|
|
|
michael_jhons wrote: is there any way to directly attach the datatable to an email
Not that I can think of. An attachment has to be a physical file rather than an abstraction in memory, unless you write the data into the body of the email (rather a silly solution actually).
Why not clean up the attachment file after it has been sent? You could even clean out the attachment folder prior to sending the next email or have a job that periodically cleans the attachments, there are many options here.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thank you Mycroft for your answer, that's what i was thinking about but i wanted to be more sure
|
|
|
|
|
Sorry to ask such a basic question, actually I'm new to C#.
I want to have a non-editable combo-box on my form (where user can choose from the items, but can not edit/type a new item into the combo. The .net 2005 forms editor gives me 2 choices (i) Create a list-box, which I don't want, as I need a drop-down (ii) Create a Combo-box, but that is always editable.
In VS6, we could create a combo and then in its properties we could choose the type to be list box, but I could not find any such property in C#. Any help is appreciated.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
DropdownStyle=DropDwonList
sepel
|
|
|
|
|
ur very helpful!!!thanks for the info..
|
|
|
|
|
Use DropDownStyle property of combobox class.
|
|
|
|
|
Thank you guys for the quick help
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
You are welcome
|
|
|
|
|
do this
private void MyComboBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar < 256)
e.Handled = true;
}
user can´t press any key! just select
You may try also use this for textboxes that you want to get just numbers (and backspace key)
private void MyTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < 48) || (e.KeyChar > 57))
e.Handled = true;
if (e.KeyChar == 8)
e.Handled = false;
}
As you see this way you can avoid doind some validations like try{}catch{}
Learn the ascii code to know the keys you are allowing or not
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
This won't handle the case of somebody using the mouse to paste data or cutting data for that matter. The solutions given previously are what the OP needed in his situation. In the more general scenario that you're preempting, to be successful you need to at least ...
override OnKeyDown
override OnTextChanged
override WndProc and trap WM_PASTE and WM_CUT
... being careful to allow navigation keys like Home, End, Tab, Shift+Tab and the arrow keys if appropriate.
If you just disable all keys the UI becomes very non-standard and the user will hate you and your software!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
|
Thank you DaveyM69 for the tip. Although the solution proposed by
nelsonpaixao is not what I was looking for and my current need is perfectly addressed by making DropdownStyle=DropDwonList, I will keep this solution in mind for some later day, e.g. when I need a textbox that only accepts numbers. Thank you nelsonpaixao.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
.hey friends! can you help me in changing look&feel in C# winforms and please also help me using flash objects, menus, buttons in creating a winform application for standalone pc's any answer or suggestion for this then give it to me. IT IS URGENT! currently i am using vs 2005 and 2008
|
|
|
|
|
WinForms doesn't come with skinnig support (WPF does) but you can use third party libraries such as DotNetSkin[^] or IrisSkin[^]
|
|
|
|
|
Firstly, bold text should be used only to highlight a single point, not an entire post. It is tantamount to shouting, only BOLD CAPITALS are worse. Oops, I notice that as well.
Secondly, what have you tried? Give an example of where you are stuck and help will come. "urgent! send codz plz!" (tm) is not asking for help, it is asking to be chastised.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
i means here not to send whole code but to send some help snipts for look & feel in C# winform applications as you can see in java the look and feel controled by:--
com.plaf.metal.metallookandfeel;
or
com.plaf.motif.motiflookandfeel; etc.
|
|
|
|
|
Hi all,
I have a requirement of exporting image to MS Word, PowerPoint and PDF.
please suggest me how to do that.
Thanks in advance.
cheers,
sekhar
|
|
|
|
|
I have an article about converting image files to PDF. Check my profile. As for the MS formats, there are paid tools. I don't know of any free one.
|
|
|
|
|
Hi I was wondering if anybody knows how to create a MSI project(Setup and Deployment project). I am using Visual studio to do this but can't figure out how to pass parameters entered on screen to my registry. Any help would be appreaciated
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
|
OK lets say I've got a form that sets regestry values. I must add an installer class to that project and then add that project to the custom actions. Is that right?
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Yes that's along the right lines.
Generally your project will output a single assembly (exe / dll). That assembly may have some requirements that need to be created at installation time - in your case, registry entries.
So you build an installer class into each assembly, which handles the requirements for that assembly.
So your installer class in this case, will read the parameters that are passed to it from the msi (which the user typed into the msi gui). It will then use these parameters when creating the registry entries.
The assembly in question needs to be added to the custom actions - this is how the msi knows to look into that assembly and find the installer class and call its methods.
The mapping between the msi gui fields and the CustomActionData property of the custom action in the deployment package designer is something like this:
/MasterClientID=[MASTERCLIENTID] /LoggingPath=[LOGGINGPATH] /LogMsgsPath=[LOGMSGSPATH] /LogDbConnStr=[LOGDBCONNSTR]
The code for retrieving the parameters in the installer is something like this:
public override void Commit(IDictionary savedState)
{
string mstrClientId = Context.Parameters["MasterClientID"];
string loggingPath = Context.Parameters["LoggingPath"];
|
|
|
|
|
Hi,
how can i create crystal report by code, not with the given objects in c#2008, is there a good article?
Thanks
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi,
private void ComboBox_RaceGrandPrix_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar < 256)
e.Handled = true;
}
how can i create a classe/routine for this. I can´t do it without the "e" stuff. i repeat this in other routines to, i want to avoid that.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|