Click here to Skip to main content
15,915,164 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: using EntLibJune2005 with VS2005 Pin
ToddHileHoffer23-Aug-06 3:51
ToddHileHoffer23-Aug-06 3:51 
GeneralRe: using EntLibJune2005 with VS2005 Pin
Praveen_S23-Aug-06 18:37
Praveen_S23-Aug-06 18:37 
QuestionHow to save 'Migración Líneas 1&2' in SQL SERVER 2000 Pin
BalasahebK23-Aug-06 3:10
BalasahebK23-Aug-06 3:10 
Questionlooping through arraylist Pin
playout23-Aug-06 2:42
playout23-Aug-06 2:42 
AnswerRe: looping through arraylist Pin
ToddHileHoffer23-Aug-06 3:05
ToddHileHoffer23-Aug-06 3:05 
GeneralRe: looping through arraylist Pin
playout23-Aug-06 4:03
playout23-Aug-06 4:03 
GeneralRe: looping through arraylist Pin
_AK_23-Aug-06 4:12
_AK_23-Aug-06 4:12 
GeneralRe: looping through arraylist Pin
playout23-Aug-06 4:23
playout23-Aug-06 4:23 
No data is being displayed.

I am new to the 3-tier programming method.

Basically my app works as follows:

aspx.vb file

<br />
<br />
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
           Dim strSuccess As String = Invoice.SelectInvoiceToAS400()<br />
<br />
            If strSuccess = 1 Then<br />
                lblSuccess.Text = "Successfully added to DB2"<br />
            Else<br />
                lblSuccess.text = "Unsuccessful entries"<br />
            End If<br />
            <br />
        End Sub<br />
<br />


business tier

        <br />
Public Shared Function SelectInvoiceToAS400() As Integer<br />
            Return ExportXLSDA.SelectInvoiceToAS400()<br />
End Function


data access tier (in short)

<br />
 Public Shared Function SelectInvoiceToAS400() As Integer<br />
<br />
            Dim arrErrors As New ArrayList()<br />
<br />
            Dim objInvoice As Invoice = Nothing<br />
<br />
            'Create new dataset to hold information<br />
            Dim objInvoiceDetails As New List(Of Invoice)()<br />
            Dim objConn As SqlConnection = New SqlConnection(ConnectionString())<br />
            Dim objCmd As SqlCommand = New SqlCommand("sp_SelectInvoiceDetails", objConn)<br />
<br />
            'Mark the command as a TEXT Select<br />
            objCmd.CommandType = CommandType.StoredProcedure<br />
<br />
            'Open the connection<br />
<br />
            objConn.Open()<br />
<br />
            Try<br />
                Dim objDr As SqlDataReader = objCmd.ExecuteReader()<br />
<br />
dim arrErrors as new Arraylist()<br />
<br />
While (objDr.Read())<br />
objInvoice = New Invoice()<br />
objInvoice.InvoiceDate = objDr(0).ToString<br />
objInvoice.InvoiceNumber = objDr(1).ToString<br />
objInvoice.InvoiceSubHead = objDr(2).ToString<br />
objInvoice.InvoiceTotal = objDr(3).ToString<br />
objInvoice.InvoiceSignoffBy = objDr(4).ToString<br />
objInvoice.InvoiceSubmittedBy = objDr(5).ToString<br />
<br />
<br />
If objInvoice.InvoiceSubmittedBy = "" Then<br />
arrErrors.Add("An error occured retrieving record" & objInvoice.InvoiceNumber)<br />
<br />
Else<br />
<br />
objInvoiceDetails.Add(objInvoice)<br />
End If<br />
<br />
End While<br />
<br />
            Catch ex As Exception<br />
<br />
                Dim strExceptionMsg As String = "Error Executing GetAS400InvoiceDetails(): " & ex.Message & "\r\n"<br />
                Throw New Exception(strExceptionMsg, ex)<br />
<br />
            Finally<br />
                objConn.Close()<br />
<br />
            End Try<br />
<br />
<br />
                Dim intCount As Integer = 0<br />
                Do While intCount < arrShowDetails.Count<br />
                    lblShowDetails.Text += arrShowDetails(intCount).ToString<br />
                    intCount += 1<br />
                Loop<br />
<br />
            Return 1<br />
<br />
        End Function

GeneralRe: looping through arraylist Pin
_AK_23-Aug-06 4:27
_AK_23-Aug-06 4:27 
GeneralRe: looping through arraylist Pin
playout23-Aug-06 4:33
playout23-Aug-06 4:33 
GeneralRe: looping through arraylist Pin
_AK_23-Aug-06 18:37
_AK_23-Aug-06 18:37 
GeneralRe: looping through arraylist [modified] Pin
ToddHileHoffer23-Aug-06 4:22
ToddHileHoffer23-Aug-06 4:22 
GeneralRe: looping through arraylist Pin
playout23-Aug-06 4:37
playout23-Aug-06 4:37 
GeneralRe: looping through arraylist [modified] Pin
ToddHileHoffer23-Aug-06 4:49
ToddHileHoffer23-Aug-06 4:49 
GeneralRe: looping through arraylist Pin
playout23-Aug-06 7:39
playout23-Aug-06 7:39 
QuestionArray in Javascript page Pin
Irshad Sulaimani23-Aug-06 2:19
Irshad Sulaimani23-Aug-06 2:19 
AnswerRe: Array in Javascript page Pin
Not Active23-Aug-06 3:54
mentorNot Active23-Aug-06 3:54 
QuestionHi datagrid experts....... Pin
Nagraj Naik23-Aug-06 1:58
Nagraj Naik23-Aug-06 1:58 
QuestionHow to get the disk space usage of server Pin
Amit Agarrwal23-Aug-06 1:56
Amit Agarrwal23-Aug-06 1:56 
Questionhow to configuration asp.net in vs2005 ? Pin
hdv21223-Aug-06 1:53
hdv21223-Aug-06 1:53 
AnswerRe: how to configuration asp.net in vs2005 ? Pin
Naveed Kamboh23-Aug-06 3:09
Naveed Kamboh23-Aug-06 3:09 
GeneralRe: how to configuration asp.net in vs2005 ? Pin
hdv21223-Aug-06 4:28
hdv21223-Aug-06 4:28 
AnswerRe: how to configuration asp.net in vs2005 ? Pin
Suresh Pirsquare24-Aug-06 4:09
Suresh Pirsquare24-Aug-06 4:09 
Questioncan use two events in the same button Pin
Kissy1623-Aug-06 1:23
Kissy1623-Aug-06 1:23 
AnswerRe: can use two events in the same button Pin
Not Active23-Aug-06 1:35
mentorNot Active23-Aug-06 1:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.