Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

As it shown in the image i upload , Please give me information how to do SMS application like that..

Think that there exists gridView Columns like it ( datas obtained from excel to gridView )

|    NAME     |     SURNAME    |     AGE   |       FINALSCORE   |

    JOHN            GATES            33              85
    COLINS          GATEWAY          25              75


When i send sms like: "DEAR MR. {NAME} {SURNAME} YOUR AGE IS {AGE} . AND YOUR FINAL SCORE IS {FINALSCORE} . SINCERELY.."

Message will send like :
"DEAR MR. JOHN GATES YOUR AGE IS 33 . AND YOUR FINAL SCORE IS 85 . SINCERELY.."<br />
"DEAR MR.  COLINS  GATEWAY YOUR AGE IS  25 . AND YOUR FINAL SCORE IS 75 . SINCERELY.."


IMAGE PICTURED İS HERE http://img474.yukle.tc/images/9554Adsiz.png[^]
Posted
Updated 27-Mar-13 9:07am
v2
Comments
[no name] 24-Mar-13 16:24pm    
And what have you tried to do for yourself?
beratxt 24-Mar-13 16:37pm    
can you give me scenaria ? i tried the code below but strange int grdCount = dataGridView1.Rows.Count-1;
//MessageBox.Show(grdCount.ToString());

string kolonAdi = dataGridView1.Columns["AD"].HeaderText;
string test = "{" + kolonAdi + "}";
if (textBox1.Text.Contains(test) )
{
for (int i = 0; i < grdCount; i++)
{
listBox1.Items.Add(textBox1.Text.Replace(test,dataGridView1.Rows[i].Cells[0].Value.ToString()));
}
}
[no name] 24-Mar-13 18:16pm    
And so what is the problem?
CHill60 24-Mar-13 19:23pm    
You could try not SHOUTING

<pre lang="c#">
protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gr in GridView1.Rows)
        {
            string name = gr.Cells[0].Text;
            string surname = gr.Cells[0].Text;
            string age = gr.Cells[0].Text;
            string score = gr.Cells[0].Text;
            string finalMsg = "DEAR MR. " + name + " " + surname + ".YOUR AGE IS " + age + " . AND YOUR FINAL SCORE IS " + score + " . SINCERELY..";

            //Function to send message
            msgSend(finalMsg );
            
        }
    }



Use this code.It will work.
 
Share this answer
 
Comments
Maciej Los 27-Mar-13 15:15pm    
I prefer to use String.Format[^] method.
string finalMsg = Format("DEAR MR. {0} {1}.YOUR AGE IS {2}. AND YOUR FINAL SCORE IS {4}. SINCERELY..", column1, column2, column3, column4, column5);
beratxt 3-Apr-13 13:40pm    
But it doesnt standart column variables..

All datas will be taken from Excel file using openFiledialog .But all my customers doesnt have the same column like SCORE , AGE , NAME , SUR NAME ... AND COLUMN COUNT CHANGES...

HOW CAN I DO IT ALSO ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900