TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nathan R
NA
13
15.9k
how to count the execution of a method
Mar 13 2014 5:37 AM
Sir,
Please help me.
I am in a function to send sms in c# windows application.
I want to count this string occurance and update the sms send phone number.
Please Provide me the code to count string occurance.
Here the function:-
private void frmSMS_Load(object sender, EventArgs e)
{
SqlDataReader rdr = null;
string Phone = string.Empty;
string Msg = string.Empty;
string userID = "
[email protected]
";
string Pswrd = "sms12345";
try
{
string cnn = ConfigurationManager.ConnectionStrings["MSCon"].ToString();
SqlConnection cn = new SqlConnection(cnn);
cn.Open();
SqlCommand cmd = new SqlCommand("Get_PatientPhoneNo", cn);
cmd.CommandType = CommandType.StoredProcedure;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Phone = rdr["PHONE"].ToString();
Msg = rdr["COMMENTS"].ToString();
string strCount=SendSMSUsingBS(userID, Pswrd, Phone, Msg);
if (strCount == "1")
{
string cnn1 = ConfigurationManager.ConnectionStrings["MSCon"].ToString();
SqlConnection cn1 = new SqlConnection(cnn);
cn.Open();
SqlCommand cmd1 = new SqlCommand("Update_Sms_Status", cn1);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapter.Fill(ds);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex + "SMS01", "SMS", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
Reply
Answers (
2
)
how to use hirachyid in asp.net c# to view and trace tree st
Log in Failed Error in Crystal Report