thanks for the reply Manas..my SMTP settings are as follows : General-> IP Address -> [All Unassigned] Access->Relay->Relay Restrictions->Only the list below->access granted to 127.0.0.1 and also to the IP address of my computer, also the SMTP server is running....do i have to make any changes to the configuration?
varun_mca_ju 0
Posts
-
problem in sending SMTP mail -
problem in sending SMTP mailthanks for the reply SSK :) , but there's not much of a difference between my code and your code .What i wanted to know was that why is the mail not being sent?
-
problem in sending SMTP maili am using Visual Studio 2005 and i'm using the following code to send mail:- try { MailMessage mail = new MailMessage(); mail.To = varunmcaju@gmail.com; mail.From = varun_mcaju@rediffmail.com; mail.Body = "Sending mail through .NET SMTP mail"; SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mail); MessageBox.Show("Mail sent successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } when i run this code it gives no error ...but the mail is never delivered. Then i checked the C:\Inetpub\mailroot\Queue folder and found the following message "This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. varunmcaju@gmail.com " why is it unable to connect to the destination server :~...any ideas? thanks in advance
-
saving textbox value after form closingi'm not sure if this can be done using a static variable....can a static variable retain its last value when the page loads again? :confused:
-
inserting datausing System.Data.SqlClient; using System.Data.OleDb; code for connecting to SQL database:- try { SqlConnection mc = new SqlConnection(Persist Security Info=False;User ID=sa;Initial Catalog=DataBase_Name;Data Source= SQL_Server_Name"); SqlDataAdapter da =new SqlDataAdapter("Select * from Table_name", mc); DataSet ds =new DataSet(); da.Fill(ds,"Table_name"); MessageBox.Show("Connection Successfull"); } catch(Exception ex) {MessageBox.Show(ex.Message); } code for inserting data from textBox:- try{ SqlCommand insertCmd=new SqlCommand("insert into Table_Name(Column_Name)values(@Variable_name)",Connection_Name); insertCmd.Parameters.Add("@Variable_Name",SqlDbType.Nchar,10); insertCmd.Parameters["@Variable_Name"].Value=textBox1.Text; insertCmd.ExecuteNonQuery(); MessageBox.Show("Records inserted successfully"); } catch(Exception ex) {MessageBox.Show(ex.Message);}
-
how can i change machain datesee the extreme bottom-right of your computer screen(where the system time is displayed),double click the system time being displayed...and make the changes :)
-
incrementing using C#.NetThanks Ashfield. What i want is that on clicking a button PRINT the data in the BILL NO. textbox should be incremented and entered into a particular field of a database. I know how to enter the data from the textbox to the database . But the problem is that if i have entered 0 in the BILL NO. textbox and click the PRINT button, 1 is entered into the database field but when i close the application and run it again, the increment again starts from 0. I want that if the value in the textbox was 1 when the application was last run...it should be incremented to 2 when i run the application this time . i think i have made myself clear...but if u need any more background plz let me know...thanks for giving me the time
-
saving textbox value after form closingi have a C# windows application form and i want that on clicking a button the value in a textBox should be incremented. for e.g. if i have entered 0 in the textBox ,every time i click the button the value in textBox should be incremented to 1,2,3,...and so on.But everytime the form runs the increment starts from 0. Is there any way to store the value contained in the textBox after the form closes and increment that value when i click the button when the form runs the next time?...Plz. Help :confused:
-
Validation window is opening but in minimised statego to the properties of the window and set the Window State property to Normal.
-
incrementing using C#.Netthanks for the reply Ashfield...but i am new to C# programming...could you please give me a hint as to how to do it?
-
inserting dataare you trying to insert data from textBox or other controls? are you using Oracle or SQl ?...plz. give some details....
-
incrementing using C#.Netthanks for the reply Allen :) ...that's exactly what i wanted....i am new to .net programming so could you please give me a hint as to how i can store the value each time the application is closed and then read it back again into the text box and increment the value.
-
incrementing using C#.Net[Message Deleted]
-
incrementing using C#.Neti have a C# windows application in which i have a button PRINT .On clicking the button, data from textboxes is taken and inserted into particular cells of an MS Excel sheet. I have a textbox BILL NO. and i want that every time i click the PRINT button the value in BILL NO.textbox should be incremented so that it can be inserted into a particular cell of MS Excel sheet. for e.g. if i have entered 0 in the BILL NO. textbox,everytime i click the PRINT button the text in the textbox should be incremented to 1,2,3....and so on. i have tried a few options ...but whenever i run the application the count starts from 0......PLZ. HElp :(
-
adding data to MS Excel in C#.netthanks for the reply Paul ...it would be great if you could explain the technique to me as i am a novice in the field of C#.Net programming :sigh:
-
adding data to MS Excel in C#.neti have a C# windows application form with various controls such as textbox ,combo box,date time picker etc. i want that on clicking a button PRINT the data entered by the user in the controls should be added to particular cells of an existing Excel sheet (for e.g. i have to add the data in textBox1 to a particular cell of sheet1.xls saved on desktop)and then the sheet should be printed..i don't want the data to be saved on the sheet as i want that the next time i click the PRINT button the new data should be entered to the same cell. ...plz help and thanks in advance
-
printing in C#.netthanks a lot teejayem :rose:...your code works like a charm ...only one correction... PrintDocument printDocument1 = new PrintDocument(); had to be declared....thanks a lot...u saved my day(infact u saved me many hours of searching on google) :-D
-
printing in C#.netthanks for the reply teejayem...the link to MSDN print document class was good but in the coding we have to give the path of the file to be printed .... streamToPrint = new StreamReader ("C:\\Documents and Settings\\Administrator\\My Documents\\doc1.txt");..... but what i wanted was that the text entered by the user in the text box etc. of the running form should be printed...how can i do that?:~
-
printing in C#.neti have a C# windows application in Visual Studio. I have a form which is opened in a panel.i want to print the data in various controls of the form upon clicking a PRINT button.but i don't want to print the jpg image of the entire form or any of its controls.i want that the text in the controls should be printed.for e.g. i have a label NAME:- and a textbox txtName in front of the label and suppose the user enters the name john in the textbox . iwant that they should be printed as follows: NAME:- john the enitre label and text box should not be printed but only the text in them should be printed.....is there any way to do it....is there any alternative way like adding the data in textbox and label to an MS Word document and then printing the document...plz. help...thanx in advance. :confused:
-
ORA-00936:missing expressionI have a textbox called "textBox6.text" in a C# Windows Application in Visual Studio, and i want that the text entered by the user in the textbox should be added to the "PURPOSE" field in a table "TABLE2_HDB1" in Oracle database "HDB1" on clicking a "submit" button. the coding for submit button is as follows:- private void button1_Click(object sender, EventArgs e) { string OracleStmt; string ConString; OleDbConnection cn = null; OleDbCommand cmd = null; try { OracleStmt = "insert into TABLE2_HDB1(PURPOSE) values(@PURPOSE)"; ConString = " Provider=MSDAORA;Data Source=HDb1;User Id=SYSTEM ;Password=*****;"; cn = new OleDbConnection(ConString); cmd = new OleDbCommand(OracleStmt, cn); cmd.Parameters.Add(new OleDbParameter("@PURPOSE", OleDbType.VarChar , 20)); cmd.Parameters["@PURPOSE"].Value = textBox6.Text; cn.Open(); cmd.ExecuteNonQuery(); textBox8 .Text = "record inserted successfully"; } catch (Exception ex) { textBox8 .Text = ex.Message; } finally { cn.Close(); } } on executing this code u get the error :- ORA-00936:missing expression plz. help :~