|
|
1) Don't shout.
2) Make your mind up:
Member 11579870 wrote: this is the code but working/blockquote>
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Well apart from the fact you missed "not" out of the sentence, and apart from the fact that code won't compile (C# is case sensitive!), that is an infinite loop.
Other than that what do you mean by "not working"? Explain what happens or what exception is raised
|
|
|
|
|
Personally, I'd consider using something like this:
StringBuilder sb = new StringBuilder();
foreach (var row in dt.Rows)
{
sb.AppendFormat("{0};", row["columnname"]);
}
txt1.Text = sb.ToString();
|
|
|
|
|
thank you but not working
|
|
|
|
|
Error 2 Cannot apply indexing with [] to an expression of type 'object'
Error 3 The name 'textbox1' does not exist in the current context
my text box name is textbox1
|
|
|
|
|
Error 3 says that textbox1 isn't visible in that class.
Error 2 - well, the error will give you a line number. What's at that line? Double click on the error in the error window and Visual Studio will take you to that line (note, this is the error window, not the output window).
|
|
|
|
|
If you were expecting someone to write your code for you and do it perfectly, you're really don't have a clue how a forum like this works.
How is that going to happen when we can't see your code? (Don't bother posting it.) It's simply not possible.
It's YOUR JOB to take the code EXAMPLE Pete posted posted and adapt it to your code and situation. Go through the code and try to understand exactly what it's doing. If you don't know, lookup what each item in a statement does in the MSDN documentation.
If you don't understand the code, how on Earth are you going to expand on it and support it?
|
|
|
|
|
|
I am using C# with WPF. Database will be in server system. Client System will have only Sofware. I am new to Client and server. Server and client connected through LAN. Server windows 7 os
|
|
|
|
|
|
This is done by using a "provider" that is able to talk to the database (making connections, sending SQL queries and retrieving data, errors, ...).
There are several different providers for Oracle. probably the best is ODP.Net, but you also have OleDb or ODBC providers. I'd recommend wrapping the provider classes with a DAL (Data Access Layers) component.
Feel free to read this[^] article to get an idea.
To connect to the correct database you need a connectionstring. Look here[^] for more info.
Do a prototype first before directly changing your good application .
hope this helps.
|
|
|
|
|
hello
i'm using c# to create an application to send email to multiple email address that stored in datagridview column
this is the code for sending to single email
try
{
SmtpClient client=new SmtpClient("smtp.gmail.com",587);
MailMessage message = new MailMessage();
message.From = new MailAddress(txtemail.Text);
message.To.Add(txtreciever.Text);
message.Body = txtbody.Text;
message.Subject = txtsubject.Text;
client.UseDefaultCredentials = false;
client.EnableSsl = true;
if (txtattachment.Text != "")
{
message.Attachments.Add(new Attachment(txtattachment.Text));
}
client.Credentials = new System.Net.NetworkCredential(txtemail.Text, txtpassword.Text);
client.Send(message);
message = null;
MessageBox.Show("Message Sent");
}
catch(Exception ex)
{
MessageBox.Show( "Failed to Send Message");
}
|
|
|
|
|
And?
What's the problem you are having with multiple sends?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
it sends only to one email >> message.To.Add(txtreciever.Text);
i have datagridview i need get emails from email column and send my email to all
|
|
|
|
|
Well, you know how to get the contents of a DGV column, I assume?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
yes i can get it and send to richtextbox
but i dont know how to get it from richtext and separate each email and send email one by one
|
|
|
|
|
Why send multiple emails? Send a single email to multiple recipients.
Set the To address to your own, and add the emails to the BCC , separated by semi-colons.
Each recipient will get a copy of the email, and will not see the other addresses.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
thats exactly what i want sorry for my bad english
can just correct it by code
|
|
|
|
|
You need to loop through the rows in the dataset.
Create the email object, set the text, attachments etc as you do now, then loop through the dataset, adding the email address, followed by a semicolon, to the BCC address, so at the end of the loop it will look something like:
joe.bloggs@email.co.uk;jane.do@hotmail.com;member.11579870@codeproject.com;
After populating the address field, send the email.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Why send it to an RTB? If you can get the data on a row by row basis, then you already have hem separated...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
how to bind sql data in kendo ui grid in webpage not in mvc
|
|
|
|
|
|
I have a followin problem. My task is to create a simple chart drawing library(like Windows Charts for example). I have already tried tu use Graphics class but there are few problems with this approach. When using Graphics i have no control over stuff that I already drawn. I need a way to interact with drawn objects - to erase a specific point or line from the view, or to make a mouse hover events. I simply ask for some guidance how to even start.
|
|
|
|
|
If it's alright for you to borrow some ideas from other projects then you will find a lot of articles when you google for "codeproject chart designer" or "codeproject report designer".
Otherwise my suggestion would be: Have an anchor point for each graphical element and, depending on the shape of the element, zero to many track-points. Keep these points in some collection: Maybe a simple List<T> to start off with but probably there's room for optimization. Subscribe to mouse-move-events and calculate the distance of the mouse pointer to these points to determine the closest point (there's the optimization potential: if it's not a simple List but a structure that lets you sort the points by their x- any y-coordinates then you could find the closest point faster). If the distance is below a chosen threshold, change the mouse pointer to indicate the possibility of some action - like dragging the shape. If the user clicks and holds the mouse button, change the shapes coordinates (or dimensions) according to the mouse movement until he releases the mouse button while repainting the graphics area.
Would this be the sort of guidance you were asking for?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|