473,396 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Geting error ---object reference not set to an instance---at bold line----plz reply

/*Geting error ---object reference not set to an instance---at bold line----plz reply asap thanks in advance*/


cmd = new OleDbCommand ("SELECT e.emp_id,e.email, m.email AS Email FROM emp_details e INNER JOIN emp_details m ON e.spid = m.emp_id AND e.emp_id='" + e_id + "'",conn);
dr=cmd.ExecuteReader();
if(dr.Read())
{
strmail=dr["email"].ToString();
strmailto=dr["Email"].ToString();
}
dr.Close();
MailMessage mail=new MailMessage();
mail.To=strmailto;
mail.From = strmail ;
mail.Subject="Leave Application From";
//mail.Body= Mam & s & txtremak.Text ;
mail.Body=txtremark.Text;
mail.BodyFormat=MailFormat.Html;
mail.Priority = MailPriority.Normal;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver","localhost");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport","25");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", "2");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","abc@abc.com");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","abc123");
SmtpMail.SmtpServer.Insert(0,"localhost");
SmtpMail.Send(mail);
conn.Close();
Jul 2 '07 #1
2 1517
kenobewan
4,871 Expert 4TB
I see the problem as being the line before - mail.Body=txtremark.Text;.
Jul 2 '07 #2
i did at own... its very easy...
Jul 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paloma García | last post by:
Dear all, I have created personalized configuration sections in my web project following the instructions described in this page...
0
by: FredC | last post by:
OS Name Microsoft Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600 Total Physical Memory 1,024.00 MB MDE 2003 Version 7.1.3008 ..NET Framework 1.1 Version 1.1.4322 SP1...
0
by: Michael Chong | last post by:
I have an (exe) executable program created in VB.NET 2003 that calls to a MFC DLL written in VC++.NET 2003. I always get an error msg "NullReferenceException: Object Reference Not Set to an...
13
by: Max | last post by:
Hi There! I'm having a mysterious error right after I login using Forms Authentication in my ASP.NET app. Below is the error... Exception Details: System.NullReferenceException: Object...
2
by: Giovanni Bassi | last post by:
Hello All, I have encountered a problem. I am using visual inheritance and my base form adds an event handler on Form Load using the AddHandler Keyword. The problem is that if the Event...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
8
by: ST | last post by:
Hello everyone, Can anyone help me with this error above when I debug my web app project in vstudio.net?? I can't figure it out! It was working fine for months, and now all of a sudden it's not!!...
3
by: SAL | last post by:
I am getting the following ERROR in my WebApp on line 30: Server Error in '/TestWebApp' Application. -------------------------------------------------------------------------------- Object...
2
by: facole | last post by:
I'm new to the .net environment. What I'm trying to do is to have an html page call a .aspx application and pass certain information. I have a field in the html file <input type="text"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.