Question : try catch

IN silverlight I am accessing a website and want some  error catching.

I am accessing a DB like these 2 snippets from svc file and in main program.


 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
<OperationContract()> _
   Public Sub updatedataSin(ByVal myid As String)
        Dim db2 As New trigTrainer6.Web.DataClasses1DataContext
        Dim temp As result
        Dim mylist As New List(Of result)


        'what this does is get data from the database in results which is a list undeclared 'variant
        'with this list I populate each record into an existing class.


        Dim myresults = (From p In db2.results _
                        Where p.id = myid _
                        Select p)

        If myresults.Count > 0 Then 'only bother if the user name exists which it will
            For Each p As result In myresults
                p.sin = p.sin + 1


            Next
            db2.SubmitChanges()


        End If

 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
<OperationContract()> _
   Public Sub updatedataSin(ByVal myid As String)
        Dim db2 As New trigTrainer6.Web.DataClasses1DataContext
        Dim temp As result
        Dim mylist As New List(Of result)


        'what this does is get data from the database in results which is a list undeclared 'variant
        'with this list I populate each record into an existing class.


        Dim myresults = (From p In db2.results _
                        Where p.id = myid _
                        Select p)

        If myresults.Count > 0 Then 'only bother if the user name exists which it will
            For Each p As result In myresults
                p.sin = p.sin + 1


            Next
            db2.SubmitChanges()


        End If

Answer : try catch

pop.gmail.com is an alias, which your ISP dns might have messed up trying to resolve.

you could set outlook to use:  gmail-pop.l.google.com
which is the real "A" record (one of many) for pop.gmail.com
note that's a letter L in there not a one

you don't want to hard-code your own dns entry for pop.gmail.com because, it can change - and you wouldn't know.

this way if the ip changes, it'll still resolve correctly
Random Solutions  
 
programming4us programming4us