Thursday, 28 November 2013

vb.net


            Dim dt1 As DataTable = database.getdata("Select sno,emailid,password,allocated from MailForAnonymous")
            If dt1.Rows.Count > 0 Then
                For i = 0 To dt1.Rows.Count - 1
                    grdanonymousemail.Rows.Add()
                    grdanonymousemail.Rows(i).Cells("dbsno").Value = k
                    grdanonymousemail.Rows(i).Cells(1).Value = dt1.Rows(i).Item("emailid")
                    grdanonymousemail.Rows(i).Cells(2).Value = dt1.Rows(i).Item("password")
                    grdanonymousemail.Rows(i).Cells(3).Value = dt1.Rows(i).Item("allocated")
                    If grdanonymousemail.Rows(i).Cells(3).Value.ToString() <> "" Then
                        grdanonymousemail.Rows(i).Cells(4).Value = 1
                        grdanonymousemail.Rows(i).ReadOnly = True
                    Else
                        grdanonymousemail.Rows(i).Cells(4).Value = 2
                    End If
                    grdanonymousemail.Rows(i).Cells(5).Value = dt1.Rows(i).Item("sno")
                    k = k + 1
                Next