开发者

How to detect Updated textbox with Linq

-->VB.Net VS2010

If this is a stu开发者_运维技巧pid question, then let me know. I can't just figure it out. First of all, this is my question. How do I detect the changed value on those text boxes?

I have an idea that I create a another string values that have the original values and compare them right before saving or form closing event. This sample just have 3 text boxes, but I have 50 + text boxes on my one form. I can do it that way, but that is not really smart idea.

Can I use abcDB.SubmitChanges() to detect any data changes on text boxes?

Dim sqlQuery = (From obj in abcDB.HelloWorld 
               Select obj.Fname, obj.Lname, obj.PhoneNumber).FirstOrDefault()

me.textboxFname.text = sqlQuery.Fname
me.textboxLname.text = sqlQuery.Lname
me.textboxPhoneNumber.text = sqlQuery.PhoneNumber


What you really want to do is called 'data binding'. Lots of tutorials about that aroud the web and any book about VB.NET will have at least 1 chapter dedicated to it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜