Click here to Skip to main content
15,896,726 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Using VB.Net printing Pin
Eddy Vluggen15-Aug-12 1:13
professionalEddy Vluggen15-Aug-12 1:13 
QuestionVisual Studio Expenses Project Pin
garyu8714-Aug-12 5:16
garyu8714-Aug-12 5:16 
AnswerRe: Visual Studio Expenses Project Pin
Eddy Vluggen15-Aug-12 1:21
professionalEddy Vluggen15-Aug-12 1:21 
GeneralRe: Visual Studio Expenses Project Pin
garyu8715-Aug-12 21:20
garyu8715-Aug-12 21:20 
GeneralRe: Visual Studio Expenses Project Pin
Eddy Vluggen15-Aug-12 22:05
professionalEddy Vluggen15-Aug-12 22:05 
GeneralRe: Visual Studio Expenses Project Pin
garyu8715-Aug-12 22:24
garyu8715-Aug-12 22:24 
GeneralRe: Visual Studio Expenses Project Pin
Eddy Vluggen15-Aug-12 22:31
professionalEddy Vluggen15-Aug-12 22:31 
GeneralRe: Visual Studio Expenses Project Pin
garyu8716-Aug-12 2:54
garyu8716-Aug-12 2:54 
I am having a problem right now where I want to display multiple table data in the all the textboxs in a form.

Here's my coding:
VB
Sub Fill_Template()

        cmd.CommandText = "SELECT tblExpenses.Date, tblFoodAndBeverage.Breakfast, tblFoodAndBeverage.Lunch"
        cmd.CommandText += "tblFoodAndBeverage.Dinner, tblFoodAndBeverage.Snack, tblFoodAndBeverage.Beverage"
        cmd.CommandText += "tblFoodAndBeverage.Grocerries, tblFoodAndBeverage.Sub_Total, tblHousing.Rental"
        cmd.CommandText += "tblHousing.Electricity, tblHousing.Water, tblHousing.Gas, tblHousing.Supplies"
        cmd.CommandText += "tblHousing.Others, tblHousing.Sub_Total, tblTransportation.Bus_Fare"
        cmd.CommandText += "tblTransportation.Taxi_Fare, tblTransportation.Train_Fare, tblTransportation.Fuel"
        cmd.CommandText += "tblTransportation.Maintainence, tblTransportation.Others, tblTransportation.Sub_Total"
        cmd.CommandText += "tblEntertainment.Video_Rental, tblEntertainment.Cinema, tblEntertainment.Concert"
        cmd.CommandText += "tblEntertainment.Sport, tblEntertainment.Club_Bar_Disco, tblEntertainment.Games"
        cmd.CommandText += "tblEntertainment.Others, tblEntertainment.Sub_Total, tblPersonalCareAndItems.Medical_Fees"
        cmd.CommandText += "tblPersonalCareAndItems.Hair_Or_Nail, tblPersonalCareAndItems.Clothing"
        cmd.CommandText += "tblPersonalCareAndItems.Supplements, tblPersonalCareAndItems.Soap_Or_Shampoo"
        cmd.CommandText += "tblPersonalCareAndItems.Facial_Cleanser, tblPersonalCareAndItems.Others"
        cmd.CommandText += "tblPersonalCareAndItems.Sub_Total, tblLoan.Personal, tblLoan.Student, tblLoan.Business"
        cmd.CommandText += "tblLoan.Mortgage, tblLoan.Others, tblLoan.Sub_Total, tblLegal.Attorney, tblLegal.Alimony"
        cmd.CommandText += "tblLegal.Summons, tblLegal.Others, tblLegal.Sub_Total, tblPaymentsAndOthers.Phone_Bill"
        cmd.CommandText += "tblPaymentsAndOthers.College_Fee_And_Misc, tblPaymentsAndOthers.Vehicle_Payment"
        cmd.CommandText += "tblPaymentsAndOthers.Vehicle_Insurance, tblPaymentsAndOthers.Vehicle_License"
        cmd.CommandText += "tblPaymentsAndOthers.Credit_Card, tblPaymentsAndOthers.Debit_Card"
        cmd.CommandText += "tblPaymentsAndOthers.Others, tblPaymentsAndOthers.Sub_Total, tblBanking.Maybank_Balance"
        cmd.CommandText += "tblBanking.Maybank_Withdraw, tblBanking.Maybank_Deposit, tblBanking.CIMB_Balance"
        cmd.CommandText += "tblBanking.CIMB_Withdraw, tblBanking.CIMB_Deposit, tblBanking.Public_Bank_Balance"
        cmd.CommandText += "tblBanking.Public_Bank_Withdraw, tblBanking.Public_Bank_Deposit"
        cmd.CommandText += "tblBanking.Other_Bank_Balance, tblBanking.Other_Bank_Withdraw, tblBanking.Other_Bank_Deposit"
        cmd.CommandText += "tblExpenses.Allowance, tblExpenses.Total, tblExpenses.Wallet"
        cmd.CommandText += "FROM tblExpenses, tblFoodAndBeverage, tblHousing, tblTransportation, tblEntertainment"
        cmd.CommandText += "tblPersonalCareAndItems, tblPaymentsAndOthers, tblLoan, tblLegal, tblBanking)"
        cmd.CommandText += "WHERE tblExpenses.Food_And_Beverage = tblFoodAndBeverage.Food_And_BeverageID"
        cmd.CommandText += "AND tblExpenses.Housing = tblHousing.HousingID"
        cmd.CommandText += "AND tblExpenses.Transportation = tblTransportation.TransportationID"
        cmd.CommandText += "AND tblExpenses.Entertainment = tblEntertainment.EntertainmentID"
        cmd.CommandText += "AND tblExpenses.Personal_Care_And_Items = tblPersonalCareAndItems.Personal_Care_And_ItemsID"
        cmd.CommandText += "AND tblExpenses.Loan = tblLoan.LoanID"
        cmd.CommandText += "AND tblExpenses.Legal = tblLegal.LegalID"
        cmd.CommandText += "AND tblExpenses.Payments_And_Others = tblPaymentsAndOthers.Payments_And_OthersID"
        cmd.CommandText += "AND tblExpenses.Banking =tblBanking.BankingID"

        cmd.Connection = connection
        da.SelectCommand = cmd
        da.Fill(ds, "tblExpenses", "tblFoodAndBeverage", "tblHousing", "tblTransportation", )

        For Me.i = 0 To ds.Tables("tblFoodAndBeverage").Rows.Count - 1
            txtBreakFeast.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(0)
            txtLunch.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(1)
            txtDinner.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(2)
            txtSupper.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(3)
            txtSnack.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(4)
            txtBeverage.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(5)
            txtGroceries.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(6)
            txtSubFnB.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(7)
        Next
    End Sub



I am having problem with the da.fill-with multiple tables(giving me error)
AnswerRe: Visual Studio Expenses Project Pin
Eddy Vluggen16-Aug-12 3:05
professionalEddy Vluggen16-Aug-12 3:05 
GeneralRe: Visual Studio Expenses Project Pin
garyu8716-Aug-12 3:48
garyu8716-Aug-12 3:48 
AnswerRe: Visual Studio Expenses Project Pin
Eddy Vluggen16-Aug-12 5:12
professionalEddy Vluggen16-Aug-12 5:12 
GeneralRe: Visual Studio Expenses Project Pin
garyu8716-Aug-12 5:36
garyu8716-Aug-12 5:36 
GeneralRe: Visual Studio Expenses Project Pin
Eddy Vluggen16-Aug-12 5:47
professionalEddy Vluggen16-Aug-12 5:47 
QuestionRun-time 430: class doesnot support automation or does not support expected interface Pin
Karthik Chintala12-Aug-12 23:35
Karthik Chintala12-Aug-12 23:35 
AnswerRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Eddy Vluggen12-Aug-12 23:47
professionalEddy Vluggen12-Aug-12 23:47 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Karthik Chintala12-Aug-12 23:51
Karthik Chintala12-Aug-12 23:51 
AnswerRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Eddy Vluggen13-Aug-12 0:06
professionalEddy Vluggen13-Aug-12 0:06 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Karthik Chintala13-Aug-12 0:14
Karthik Chintala13-Aug-12 0:14 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Eddy Vluggen13-Aug-12 0:28
professionalEddy Vluggen13-Aug-12 0:28 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Karthik Chintala13-Aug-12 0:34
Karthik Chintala13-Aug-12 0:34 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Eddy Vluggen13-Aug-12 1:24
professionalEddy Vluggen13-Aug-12 1:24 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Karthik Chintala13-Aug-12 1:29
Karthik Chintala13-Aug-12 1:29 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Eddy Vluggen13-Aug-12 1:39
professionalEddy Vluggen13-Aug-12 1:39 
GeneralRe: Run-time 430: class doesnot support automation or does not support expected interface Pin
Karthik Chintala13-Aug-12 0:41
Karthik Chintala13-Aug-12 0:41 
QuestionButton Click acting weird Pin
dtdmike9412-Aug-12 2:12
dtdmike9412-Aug-12 2:12 

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.