sambath says:
int
count=0;
DataTable dtn = dt.Clone();
for
(
int
i = 0; i < count; i++)
{
dtn.ImportRow(dt.Rows[i]);
string
Number1 = dt.Rows[0][1].ToString();
string
Message = name +
" has requested for "
+ ddlcontent.SelectedItem +
" "
+ txtmob.Text;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(URL);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
StreamReader sr =
new
StreamReader(resp.GetResponseStream());
string
results = sr.ReadToEnd();
sr.Close();
}
Change the above code with the below.
int count = dt.Rows.Count;
DataTable dtn = dt.Clone();
for (int i = 0; i < count; i++)
{
dtn.ImportRow(dt.Rows[i]);
string Number1 = dt.Rows[i][1].ToString();
string Message = name + " has requested for " + ddlcontent.SelectedItem + " " + txtmob.Text;
string URL = "http://pay4sms.in/sendsms/?token=d9279885a4ceee392df8cf4208d0fc7344435458&credit=3&sender=SAM&message=" + Message + "&number=" + Number1 + "";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(URL);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
StreamReader sr = new StreamReader(resp.GetResponseStream());
string results = sr.ReadToEnd();
sr.Close();
}