Hi everybody,
Sub Validate_Data (Src As Object, Args As GridviewUpdaeEventArgs )

If Not IsNumeric(Args.NewValues("BookPrice")) Then
Args.Cancel = True
EditMSG.Text = "-- Book Price is not numeric. Record not updated." End If

How to write this if part in C#.

Please give the answer.

Thank you,
Aravind .

Recommended Answers

All 4 Replies

Have you even tried? It looks like all your posts are just asking us to do work for you. Show some effort please.

errr... you should at least google it first, and then ask question once you tried it and didn't work XD

but basically you need to learn how to use class in C#, it's similar to Java :D

Hi guys,
Sorry actually I am beginner in .Net technologies.Thats why I am facing problems.Any how I found the solution .And here is the solution hoping it will be useful for someone.

Please give the alternatives if any

---Updating_Row(object sender, GridViewUpdateEventArgs e)
{
string str = e.NewValues["quantity"].ToString();
        double NUM;
        bool isNum = double.TryParse(str, out NUM);
        if (isNum==false)
        {
            e.Cancel = true;
            EditMsg.Text = "-- Book Quantity is not numeric. Record not updated";

        }
}

Thank you,
Aravind

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.