3
Answers

Select a Specific row in datagrid

viviansm

viviansm

20y
2k
1
Good day. I am a beginner in VB.NET. Please help me in VB.Net coding for the following problems. Q1. I have created 2 forms - a customer form and a search form. When the user click on the Search button in the customer form , the search form will show. The user can search for the customer details either by keying the customer ID(txtCustID) or customer last name(cboCustLastName). The details will show in the datagrid as you can see in the attachment. So far everything is working fine , but how do I write the code if the user double click on the specific row in the datagrid and the details of that selected customer will appear on the customer form so that the user can do the update or delete of that customer in the customer form? Q2. In the customer form, is it possible to do something like this : when the user enter the IC No: 860608-07-5694 which 86 is the year, 06 is month and 08 is day. And this will auto generate The Date of Birth : 08/06/1986. Have a nice day! Thanks and regards, Viv
Answers (3)
0
Vulpes

Vulpes

NA 98.3k 1.5m 12y
It depends to what extent the C# 3.0 application made use of features that were introduced in that version of the language. 

If the application made heavy use of these features (notably LINQ), then it will probably be impractical to translate it to C# 2.0 and the only sensible option would be to start again.

Apart from that, a translation should be feasible as C# 3.0 is backwards compatible with C# 2.0.

For a list of the stuff that was introduced in C# 3.0, see here:

http://msdn.microsoft.com/en-us/library/bb308966.aspx 





Accepted
0
Vulpes

Vulpes

NA 98.3k 1.5m 12y
You should be able to reuse a lot of it with some simple modifications.

For example:

Implicitly typed variables - just replace 'var' with the actual type.

Lambda expressions - replace with anonymous methods which were introduced in C# 2.0.

Object and collection initializers  - should be simple to rewrite.

However, anything to do with LINQ (to objects, XML or SQL) will need to be rewritten using 'traditional' code  - there's no other way.
0
sean li

sean li

NA 3 2.6k 12y
Hi Vulpes: Thanks for your info. The application (I believe it was coded in 3.0)made use of Implicitly local variables, Lambda expressions, delegate Type, et. It didn't work properly in .NET 2.0 run time. Should we modify or start the scrach in C#2.0?