... Sending Mobile phone SMS to SQL server 2008 + aspx 3.5 RRS feed

  • Question

  • User-582711651 posted

    Dear Experts,

    Please help me this suject... 

    Am developing a banking related web based application in ASP.Net 3.5 with SQL 2008, where I would like to receive SMS from mobile (from any GSM/CDMA operator). Basically our recovery agents collects the payment to send SMS to Web Application/Server

    For Ex. Format 

    Like this... "000200912, 4000, 010003944"

    Account No. is 000200912, Amount is 4000, Receipt_No is 010003944, send to 59594 or .....(operator No)...  

    after sending the sms (based on above format) data (Account No, Amount, Receipt_no & DataofCollection) must be update to our web server...

    My DataBase Table Format,

    ID, Account_no, Amount, ReceiptNo, DateofCollection, ....... etc  

    How should I proceed in steps?

    ..... is it possibe ? 

    Thanks in Advance

    Wednesday, November 16, 2011 9:41 AM


All replies

  • User1943143334 posted


    First you need to register with one the Mobile Service Provider for SMS sending/receiving with unique number!

    I suggest you to create a WCF, which parses the incoming SMS and update it to the Database (SQL Server 2008).

    Hope it helps u...

    Wednesday, November 16, 2011 9:46 AM
  • User-582711651 posted


    Thanks for your fast reply.... 

    I will ask to get the details mobil. network provider,

    could you please expline me WCF concept, how i create that ... its tufest concept or easy one?

    Cheers !

    Wednesday, November 16, 2011 9:56 AM
  • User1943143334 posted


    WCF is very powerful related to communication! It's integration of Remoting,COM+, MSMQ etc., It's easy to learn if you are comfortable with .NET



    You can even use a web service to process the incoming SMS!


    Hope it helps u...


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 16, 2011 10:03 AM
  • User1918766559 posted

    Use a SMS Gateway with IP Gateway Service (To use service from Mobile Network Providers) . There is lots of SMS Gatewats available , choose it for Indian Operators.

    Check : http://www.ozekisms.com . They have good technical support & product benefits even there is lots of tutorials available for implementing SMS service from asp.net with Database.

    Most simplified.






    Wednesday, November 16, 2011 11:13 PM
  • User216885328 posted

    Looking through this it seems there may be a simpler way using a service called Twilio.

    Check these two links out for more information on making telephone calls and sending text messages from a single line of SQL code.



    Tuesday, November 29, 2011 11:40 PM
  • User-1773070171 posted
    1. You need an external SMS gateway to send an SMS.
    2. If you are a slacker like I am, Sign up for an API token at SMS API
    3. Use their code
      Imports System.Net
      Imports System.IO
      Partial Class demo
          Inherits System.Web.UI.Page
          Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
             SendSMS("18479790553", "ToNumber", "test")        
          End Sub
          Sub SendSMS(ByVal FromNumber As String, ByVal ToNumber As String, ByVal SMS As String)
              Dim url As String = "http://www.sendandreceivesms.com/api/"
              Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)     
              request.Method = "POST"   
              Dim postData As String = "FromNumber=" & FromNumber
              postData += "&"
              postData += "ToNumber=" & ToNumber
              postData += "&"
              postData += "SMS=" & SMS
              Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)       
              request.ContentType = "application/x-www-form-urlencoded"    
              request.Headers.Add("APIToken", "GET API TOKEN BY REGISTERING")      
              request.ContentLength = byteArray.Length    
              Dim dataStream As Stream = request.GetRequestStream()   
              dataStream.Write(byteArray, 0, byteArray.Length)        
              Dim response As WebResponse = request.GetResponse()            
              dataStream = response.GetResponseStream()      
              Dim reader As New StreamReader(dataStream)      
              Dim responseFromServer As String = reader.ReadToEnd()        
              If (responseFromServer = "") Then
                 'Label1.Text += "Nothing returned"
                  'Label1.Text += responseFromServer
              End If
          End Sub
      End Class
    Friday, December 16, 2011 3:00 AM