IMportant link of sending sms

May 15, 2013 |

here is some valuable link for sending sms

after following these link i have added sending sms in my project and it is working fine


http://weblogs.asp.net/rajneesh-verma/archive/2011/10/17/sending-sms-through-asp-net-using-sms-sending-api-from-providers.aspx
http://www.rajneeshverma.com/post/2011/10/16/Sending-SMS-through-ASPNET-using-SMS-sending-API-from-providers.aspx
Rajneesh 




Whatever wife lectures the violent baffle. 

first of all i will let you know one thing
you need to buy an api for that or you can take a demo

this code is working fine in my project

  
   2:  
   3: protected void btnSendMessage_Click(object sender, EventArgs e)
   4:     {
   5:         string senderusername = "xxxxx";
   6:         string senderpassword = "xxxx";
   7:         string senderid = "xxx";        
   8:         string sURL;
   9:         StreamReader objReader;
  10:         sURL = "http://thundersms.com/smsapps/pushsms.php?username=" + senderusername + "&password=" + senderpassword + "&sender=" + senderid + "&mobile=91" + txtMobileNumber.Text + "&type=1&message=" + txtMessage.Text;
  11:         WebRequest wrGETURL;
  12:         wrGETURL = WebRequest.Create(sURL);
  13:         try
  14:         {
  15:             Stream objStream;
  16:             objStream = wrGETURL.GetResponse().GetResponseStream();
  17:             objReader = new StreamReader(objStream);
  18:             objReader.Close();
  19:         }
  20:         catch (Exception ex)
  21:         {
  22:             ex.ToString();
  23:         }
  24:     }
  25:  

exception handling

|

try
{
   // Problematic code goes here (i.e. opening a file, connecting to a database).
}
catch
{
   // An error has been detected. You can deal with it here.
}
finally
{
   // Clean up code here, regardless of whether or not there is an error
}
 
 
 
 
for example
 
if (IsPostBack == false)
        {
            try
            {
                SqlConnection con = new SqlConnection(Data.connect);
                SqlDataAdapter da = new SqlDataAdapter("select * from StudI", con);
                SqlCommandBuilder cm = new SqlCommandBuilder(da);
                DataSet ds = new DataSet();
                da.Fill(ds, "Stud_Info");
                if (ds.Tables["Stud_Info"].Rows.Count > 0)
                {
                    GridView1.DataSource = ds.Tables["Stud_Info"];
                    GridView1.DataBind();
                }
            }
            catch(Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(GetType(), "Javascript", "<script>alert(' " + ex.Message.ToString() + "')</script>");
            }
        }