-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: harsha
Message 1 in Discussion

 Dear All, 
               I have a front end form which has a couple of dropdown menus 
which select data from the database based on the value selected, the stored 
procedure which the program accesses outputs diffrent columns when different 
values( currently 2)  from the drop down are chosen. I also have a Datagrid 
with bound columns which has all the columns that can be returned, this 
datagrid has a couple of date columns when i select one value from the drop 
down only one of the date columns should be populated and the other one should 
give blanks, but the instead of the blank the valu '1/1/0001' is being 
populated into the date column, how can i eliminate this problem.

following is the code for data access layer



    Public Class MasterDetailReport
        Private _cellLine As String
        Private _totalSamples As Integer
        Private _study As String
        Private _studyID As String
        Private _altID As String
        Private _dateRec As DateTime
        Private _date1 As DateTime
        Private _date2 As DateTime
        Private _month As Integer
        Private _sales As Decimal
        Private _dnanbr As String
        Private _geldate As DateTime




        Public Property CellLine() As String
            Get
                Return _cellLine
            End Get
            Set(ByVal Value As String)
                _cellLine = Value
            End Set
        End Property

        Public Property DNANbr() As String
            Get
                Return _dnanbr
            End Get
            Set(ByVal Value As String)
                _dnanbr = Value
            End Set
        End Property

        Public Property TotalSamples() As Integer
            Get
                Return _totalSamples
            End Get
            Set(ByVal Value As Integer)
                _totalSamples = Value
            End Set
        End Property

        Public Property Study() As String
            Get
                Return _study
            End Get
            Set(ByVal Value As String)
                _study = Value
            End Set
        End Property

        Public Property StudyID() As String
            Get
                Return _studyID
            End Get
            Set(ByVal Value As String)
                _studyID = Value
            End Set
        End Property

        Public Property AltID() As String
            Get
                Return _altID
            End Get
            Set(ByVal Value As String)
                _altID = Value
            End Set
        End Property
        Public Property DateRec() As DateTime
            Get
                Return _dateRec
            End Get
            Set(ByVal Value As DateTime)
                _dateRec = Value
            End Set
        End Property

        Public Property Date1() As DateTime
            Get
                Return _date1
            End Get
            Set(ByVal Value As DateTime)
                _date1 = Value
            End Set
        End Property
        Public Property GelDate() As DateTime
            Get
                Return _geldate
            End Get
            Set(ByVal Value As DateTime)
                _geldate = Value
            End Set
        End Property
        Public Property Date2() As DateTime
            Get
                Return _date2
            End Get
            Set(ByVal Value As DateTime)
                _date2 = Value
            End Set
        End Property

        Public Property Month() As Integer
            Get
                Return _month
            End Get
            Set(ByVal Value As Integer)
                _month = Value
            End Set
        End Property

        Public Property Sales() As Decimal
            Get
                Return _sales
            End Get
            Set(ByVal Value As Decimal)
                _sales = Value
            End Set
        End Property
        

        Public Shared Function GetSummary(ByVal year As Integer, ByVal service 
As String) As MasterDetailReportCollection
            Dim dsData As DataSet = 
SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString),
 "Reports_GetOrderSummary", year, service)
            Dim items As New MasterDetailReportCollection

            Dim row As DataRow
            For Each row In dsData.Tables(0).Rows
                Dim item As New MasterDetailReport
                item.Month = Convert.ToInt32(row("Month"))
                item.TotalSamples = Convert.ToInt32(row("TotalSamples"))
                item.Sales = Convert.ToDecimal(row("Sales"))
                items.Add(item)
            Next row
            Return items
        End Function 'GetSummary

        Public Shared Function GetDetails(ByVal year As Integer, ByVal month As 
Integer, ByVal service As String, ByVal study As String) As 
MasterDetailReportCollection
            Dim dsData As DataSet = 
SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(Global.CfgKeyConnString),
 "Reports_GetOrdersAndDetails", year, month, service, study)
            Dim items As New MasterDetailReportCollection

            Dim row As DataRow
            For Each row In dsData.Tables(0).Rows
                Dim item As New MasterDetailReport
                item.CellLine = Convert.ToString(row("Cell_Line_Nbr"))
                item.Study = Convert.ToString(row("Study"))
                item.StudyID = Convert.ToString(row("Study_ID_Nbr"))
                item.AltID = Convert.ToString(row("Alternate_ID_Nbr"))
                item.DateRec = Convert.ToDateTime(row("Date_Received"))

                If service = "Cellline" Then
                    item.Date1 = Convert.ToDateTime(row("Freeze_1_Date"))
                    item.Date2 = Convert.ToDateTime(row("Viability_1_Date"))
                ElseIf service = "dnaextraction" Then
                    item.DNANbr = Convert.ToString(row("DNA_Nbr"))
                    item.GelDate = Convert.ToDateTime(row("Gel_Date"))

                  

                End If
                items.Add(item)
            Next row
            Return items
        End Function     End Class 
End Namespace 

thank you in advance

harsha

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to