|
Thanks for adding in the answer for future reference. You might want to consider to submit it as a Trick[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi everyone,
My update statement itself doesn't have problem but when I successfully updated the bank balance and wallet cash balance, I need those 2 value to be past to the next record's bank balance and wallet cash balance with auto Calcute with the existed enter data and saved.
For example:
Data1
Date:08/09/2012
{
Breakfast: 10
Lunch: 10
Sub: 20
}
{
Mortgage: 100
Instalment: 200
sub: 300
}
{
Total: 320
}
{
Wallet Cash: 1000 (1320-320)
}
Data2
Date:09/09/2012
{
Breakfast: 10
Lunch: 30
Sub: 20
}
{
Mortgage: 100
Instalment: 200
sub: 300
}
{
Total: 350
}
{
Wallet Cash: 650 (1000 - 350)
Let's say if I change data 1's breakfast to 90 then the sub will be 100 and the total is 400. Then 1320 - 400 = Walletcash(920). Then save.
After saving how to pass 920 to data 2's wallet cash = 920 - 350 = 570 and auto save to database. This should also be done with others data like 2 onwards till the last record.
I have coded the program to use textchange,gotfocus, and lostFocus to auto calculate when user change the textbox value. Is this way good/correct or should use sql to calculate for me.
So can some give me some ideas, example, pointer to my problem. My code is very long; so, I am reluctant to put here. If you need it tell me please.
|
|
|
|
|
Hmmm ... consider this.
Not knowing how your data is stored or the amount of data being stored, I'll throw an idea out to you.
Think of this like an accounting system where you have:
1) Transaction date
2) Transaction amount
3) Account Code
4) Tranasction description
In your situation, you would have 2 accounts: W-Wallet, B-Bank
Each time you perform a transaction you have to hit the right account. To get the current balance, you would sum the amounts for that account.
For example, the first two transaction would "open" your accounts:
1) Jan 1 deposit $500 to the Bank account
2) Jan 2 deposit $100 to the Wallet account.
Here are some example transactions:
1/1/2012, +500, B, Opening deposit
1/1/2012, +100, W, Opening deposit
8/9/2012, -10, W, Breakfast
8/9/2012, -10, W, Linch
8/9/2012, -100, W, Mortgage
By summing the transacitons for B or W you could determine the balance in the account at any point in time.
Maybe this would work for you.
|
|
|
|
|
Firstly, thank you very much for the kind info but I am not sure of that.
My program is an Expenses Management. The User's will enter values to the prepared templates and then save.
When the user wanted to add a new data for the next date. Here the previous data wallet will be at the new data input template where the user will start entering value and then the wallet value will decrease and saved.(Add data is perfectly fine)
The problem is in editing(Update data). When I edit the 1st data its normal for the wallet's value to changed right and then save. Here's the problem, the changed wallet value have to be pass to the next data wallet and minus the other value to get the true value; as well as, the rest of the data.
So, how do I update these data because update only updates a selected row data only or to say how to get the wallet amount correct onwards from the other rows from the middle or previous row?
I have multiple tables that is an one to one relationship to a main table where the inside the main table has Wallet in it.
I'll show my working update statement and auto calculation here for better understanding:
Quote: Sub Update_Data()
Try
UpdateFnB = "Update tblFoodAndBeverage SET Breakfast = @Breakfast, Lunch = @Lunch, Dinner = @Dinner, Supper = @Supper, Snack = @Snack, Beverage = @Beverage, Grocerries = @Grocerries, Sub_Total = @SubFnB WHERE Food_And_BeverageID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "' "
sqlFnB = New SqlCommand(UpdateFnB, connection)
sqlFnB.Parameters.AddWithValue("@Breakfast", txtBreakFeast.Text)
sqlFnB.Parameters.AddWithValue("@Lunch", txtLunch.Text)
sqlFnB.Parameters.AddWithValue("@Dinner", txtDinner.Text)
sqlFnB.Parameters.AddWithValue("@Supper", txtSupper.Text)
sqlFnB.Parameters.AddWithValue("@Snack", txtSnack.Text)
sqlFnB.Parameters.AddWithValue("@Beverage", txtBeverage.Text)
sqlFnB.Parameters.AddWithValue("@Grocerries", txtGroceries.Text)
sqlFnB.Parameters.AddWithValue("@SubFnB", txtSubFnB.Text)
sqlFnB.ExecuteNonQuery()
UpdatePCnI = "Update tblPersonalCareAndItems SET Medical_Fees = @Medical, Hair_Or_Nail = @HairNail, Clothing = @Cloth, Supplements = @Supplement, Soap_Or_Shampoo = @SoapShampoo, Facial_Cleanser = @Facial, Others = @PCnIOthers, Sub_Total = @SubPCnI WHERE Personal_Care_And_ItemsID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "' "
sqlPCnI = New SqlCommand(UpdatePCnI, connection)
sqlPCnI.Parameters.AddWithValue("@Medical", txtMedical.Text)
sqlPCnI.Parameters.AddWithValue("@HairNail", txtHairNail.Text)
sqlPCnI.Parameters.AddWithValue("@Cloth", txtClothing.Text)
sqlPCnI.Parameters.AddWithValue("@Supplement", txtSupplement.Text)
sqlPCnI.Parameters.AddWithValue("@SoapShampoo", txtSoapShampoo.Text)
sqlPCnI.Parameters.AddWithValue("@Facial", txtFacial.Text)
sqlPCnI.Parameters.AddWithValue("@PCnIOthers", txtPCnIOthers.Text)
sqlPCnI.Parameters.AddWithValue("@SubPCnI", txtSubPCnI.Text)
sqlPCnI.ExecuteNonQuery()
UpdateEntertainment = "Update tblEntertainment SET Video_Rental = @Video, Cinema = @Cinema, Concert = @Concert, Sport = @sport, Games = @games, Club_Bar_Disco = @clubbardisco, Others = @EntertainmentOthers, Sub_Total = @SubEntertainment WHERE EntertainmentID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlEntertainment = New SqlCommand(UpdateEntertainment, connection)
sqlEntertainment.Parameters.AddWithValue("@Video", txtVideo.Text)
sqlEntertainment.Parameters.AddWithValue("@Cinema", txtCinema.Text)
sqlEntertainment.Parameters.AddWithValue("@Concert", txtConcert.Text)
sqlEntertainment.Parameters.AddWithValue("@sport", txtSport.Text)
sqlEntertainment.Parameters.AddWithValue("@games", txtGames.Text)
sqlEntertainment.Parameters.AddWithValue("@clubbardisco", txtClubBarDisco.Text)
sqlEntertainment.Parameters.AddWithValue("@EntertainmentOthers", txtEntertainmentOthers.Text)
sqlEntertainment.Parameters.AddWithValue("@SubEntertainment", txtSubEntertainment.Text)
sqlEntertainment.ExecuteNonQuery()
UpdatePnO = "Update tblPaymentsAndOthers SET Phone_Bill = @phone, College_Fee_And_Misc = @college, Vehicle_Payment = @VP, Vehicle_License = @VL, Vehicle_Insurance = @VI, Credit_Card = @Credit, [Debit_Card] = @Debit, [Others] = @PnOOthers, Sub_Total = @SubPnO WHERE Payments_And_OthersID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlPnO = New SqlCommand(UpdatePnO, connection)
sqlPnO.Parameters.AddWithValue("@phone", txtPhoneBill.Text)
sqlPnO.Parameters.AddWithValue("@college", txtCollegeFeeAndMisc.Text)
sqlPnO.Parameters.AddWithValue("@VP", txtVehiclePayment.Text)
sqlPnO.Parameters.AddWithValue("@VL", txtVehicleLicense.Text)
sqlPnO.Parameters.AddWithValue("@VI", txtVehicleInsurance.Text)
sqlPnO.Parameters.AddWithValue("@Credit", txtCardCredit.Text)
sqlPnO.Parameters.AddWithValue("@Debit", txtDebitCard.Text)
sqlPnO.Parameters.AddWithValue("@PnOOthers", txtPnOOthers.Text)
sqlPnO.Parameters.AddWithValue("@SubPnO", txtSubPaymentnOthers.Text)
UpdateTransport = "Update tblTransportation SET [Bus_Fare] = @Bus, [Taxi_Fare] = @Taxi, [Train_Fare] = @Train, [Fuel] = @Fuel, [Maintainence] = @Maintain, [Others] = @TransOther, [Sub_Total] = @SubTransport WHERE TransportationID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlTransport = New SqlCommand(UpdateTransport, connection)
sqlTransport.Parameters.AddWithValue("@Bus", txtBusFare.Text)
sqlTransport.Parameters.AddWithValue("@Taxi", txtTaxiFare.Text)
sqlTransport.Parameters.AddWithValue("@Train", txtTrainFare.Text)
sqlTransport.Parameters.AddWithValue("@Fuel", txtFuel.Text)
sqlTransport.Parameters.AddWithValue("@Maintain", txtMaintainence.Text)
sqlTransport.Parameters.AddWithValue("@TransOther", txtTansportOthers.Text)
sqlTransport.Parameters.AddWithValue("@SubTransport", txtSubTransport.Text)
sqlTransport.ExecuteNonQuery()
UpdateHousing = "Update tblHousing SET [Rental] = @Rental, [Electricity] = @Electricity, [Water] = @Water, [Gas] = @Gas, [Supplies] = @Supplies, [Other] = @HousingOthers, [Sub_Total] = @SubHousing WHERE HousingID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlHousing = New SqlCommand(UpdateHousing, connection)
sqlHousing.Parameters.AddWithValue("@Rental", txtRental.Text)
sqlHousing.Parameters.AddWithValue("@Electricity", txtElectricity.Text)
sqlHousing.Parameters.AddWithValue("@Water", txtWater.Text)
sqlHousing.Parameters.AddWithValue("@Gas", txtGas.Text)
sqlHousing.Parameters.AddWithValue("@Supplies", txtSupplies.Text)
sqlHousing.Parameters.AddWithValue("@HousingOthers", txtHousingOthers.Text)
sqlHousing.Parameters.AddWithValue("@SubHousing", txtSubHousing.Text)
sqlHousing.ExecuteNonQuery()
UpdateLoan = "Update tblLoan SET [Personal] = @Personal, [Student] = @Student, [Business] = @Business, [Mortgage] = @Mortgage, [Others] = @LoanOthers, [Sub_Total] = @SubLoan WHERE LoanID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlLoan = New SqlCommand(UpdateLoan, connection)
sqlLoan.Parameters.AddWithValue("@Personal", txtPersonal.Text)
sqlLoan.Parameters.AddWithValue("@Student", txtStudent.Text)
sqlLoan.Parameters.AddWithValue("@Business", txtBusiness.Text)
sqlLoan.Parameters.AddWithValue("@Mortgage", txtMortgage.Text)
sqlLoan.Parameters.AddWithValue("@LoanOthers", txtLoanOthers.Text)
sqlLoan.Parameters.AddWithValue("@SubLoan", txtSubLoan.Text)
sqlLoan.ExecuteNonQuery()
UpdateLegal = "Update tblLegal SET [Attorney] = @Attorney, [Alimony] = @Alimony, [Summons] = @Summons, [Others] = @LegalOthers, [Sub_Total] = @SubLegal WHERE LegalID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlLegal = New SqlCommand(UpdateLegal, connection)
sqlLegal.Parameters.AddWithValue("@Attorney", txtAttorney.Text)
sqlLegal.Parameters.AddWithValue("@Alimony", txtAlimony.Text)
sqlLegal.Parameters.AddWithValue("@Summons", txtSummon.Text)
sqlLegal.Parameters.AddWithValue("@LegalOthers", txtLegalOthers.Text)
sqlLegal.Parameters.AddWithValue("@SubLegal", txtSubLegal.Text)
UpdateBanking = "Update tblBanking SET [Maybank_Balance] = @Maybank, [Maybank_Withdraw] = @MaybankW, [Maybank_Deposit] = @MaybankD, [CIMB_Balance] = @CIMB, [CIMB_Withdraw] = @CIMBW, [CIMB_Deposit] = @CIMBD, [Public_Bank_Balance] = @Public, [Public_Bank_Withdraw] = @PublicW, [Public_Bank_Deposit] = @PublicD, [Other_Bank_Balance] = @OtherBank, [Other_Bank_Withdraw] = @OtherBankW, [Other_Bank_Deposit] = @OtherBankD WHERE BankingID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlBanking = New SqlCommand(UpdateBanking, connection)
sqlBanking.Parameters.AddWithValue("@Maybank", txtMaybank.Text)
sqlBanking.Parameters.AddWithValue("@MaybankW", txtMaybankWithdraw.Text)
sqlBanking.Parameters.AddWithValue("@MaybankD", txtMaybankDeposit.Text)
sqlBanking.Parameters.AddWithValue("@CIMB", txtCIMB.Text)
sqlBanking.Parameters.AddWithValue("@CIMBW", txtCIMBWithdraw.Text)
sqlBanking.Parameters.AddWithValue("@CIMBD", txtCIMBDeposit.Text)
sqlBanking.Parameters.AddWithValue("@Public", txtPublicBank.Text)
sqlBanking.Parameters.AddWithValue("@PublicW", txtPublickBankWithdraw.Text)
sqlBanking.Parameters.AddWithValue("@PublicD", txtPublickBankDeposit.Text)
sqlBanking.Parameters.AddWithValue("@OtherBank", txtOtherBank.Text)
sqlBanking.Parameters.AddWithValue("@OtherBankW", txtOtherBankWithdraw.Text)
sqlBanking.Parameters.AddWithValue("@OtherBankD", txtOtherBankDeposit.Text)
UpdateExpenses = "Update tblExpenses SET [Date] = @Date, [Allowance] = @Allowance, [Total] = @Total, [Wallet] = @Wallet WHERE ExpensesID = '" & LVDailyExpenses.DataGridView1.CurrentRow.Cells(0).Value.ToString & "'"
sqlExpenses = New SqlCommand(UpdateExpenses, connection)
sqlExpenses.Parameters.AddWithValue("@Date", DateTimePicker1.Value)
sqlExpenses.Parameters.AddWithValue("@Allowance", txtAllowance.Text)
sqlExpenses.Parameters.AddWithValue("@Total", txtTotalUsage.Text)
sqlExpenses.Parameters.AddWithValue("@Wallet", txtWalletCash.Text)
MsgBox("Successfully Edited Expenses")
Call LVDailyExpenses.Fill_Data()
Me.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
connection.Close()
End Sub
Auto Calculation:
Quote: Private Sub txtSubLegal_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSubLegal.TextChanged
If Not String.IsNullOrEmpty(txtSubLegal.Text) Then
If txtSubLegal.Text >= 0 Then
total_old = txtTotalUsage.Text
Total = SubFnB + SubEntertainment + SubPCnI + SubPnO + SubTransport + SubHousing + SubLoan + SubLegal
txtTotalUsage.Text = Total.ToString("#,###.00")
Wallet = txtWalletCash.Text
Wallet = (Wallet + total_old - Total)
txtWalletCash.Text = Wallet.ToString("#,###.00")
End If
End If
End Sub
Quote: Private Sub txtPublickBankWithdraw_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPublickBankWithdraw.GotFocus
Old_PublicBank_Wthdraw = txtPublickBankWithdraw.Text
End Sub
Private Sub txtPublickBankWithdraw_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPublickBankWithdraw.LostFocus
If Not String.IsNullOrEmpty(txtPublickBankWithdraw.Text) Then
If IsNumeric(txtPublickBankWithdraw.Text) Then
Public_Bank_Balance = txtPublicBank.Text
Public_Bank_Withdraw = txtPublickBankWithdraw.Text
New_Publicbank_Balance = Public_Bank_Balance - Public_Bank_Withdraw + Old_PublicBank_Wthdraw
txtPublicBank.Text = New_Publicbank_Balance.ToString("#,###.00")
Wallet = txtWalletCash.Text
Wallet1 = Wallet + Public_Bank_Withdraw - Old_PublicBank_Wthdraw
txtWalletCash.Text = Wallet1.ToString("#,###.00")
Else
MsgBox("Please Fill In Numerical Value!")
txtPublickBankWithdraw.Text = Old_PublicBank_Wthdraw.ToString("#,###.00")
End If
End If
End Sub
|
|
|
|
|
Wow. That is a lot of detail to go through ... Sorry I can't spend that much time going through each line of code.
Here are some suggestions:
1) You may want to investigate using transactions so that you can guarantee data consistency among all of your tables. If there is an update failure in one table, rollback the transaction and the data remains consistent. Commit only when you know that all updates have taken place correctly.
2) If you need to obtain the wallet amount at any point in your update, yoyou can issue a SqlCommand.ExecuteScalar function and get a numeric value.
Hope that helps.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executescalar.aspx[^]
|
|
|
|
|
Okay thanks for the pointer.
|
|
|
|
|
what is textmatrix in datagrid component...and if any one help me out how manually we get database connectivity steps...
|
|
|
|
|
sandy2050 wrote: what is textmatrix in datagrid component...
Part of the MSFlexGrid[^] monster.
sandy2050 wrote: <layer>.and if any one help me out how manually we get database connectivity steps...
Visual Basic 6 is being phased out. Best way to communicate with a database is using .NET; you can use the .NET code from your existing VB6-app, and all the tools are available for free.
I too, have stopped supporting VB6. Google is your friend.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I was wondering if anyone knew of a script I could modify to allow end users to update the Global Address List - I know there are tools available to purchase but i wish to create my own and am looking for some guidance on the subject.
Please be patient - I only have 2 speeds and if you don't like this one then you definitely won't like the other!
|
|
|
|
|
Try this[^] or this[^] site.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hello .. i hd a form , what i want is that the user will search the database either by entering Party Name or By date ..I hd succesfully acheived this , but the problem is that , when i search for partyname , the result are showned in datagrideview , but when u tried to search again the previous result does not go , its still present in datgridview..how do i get out of it ...
for much better understanding i hd posted image down there ..plz help me out
Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Da = New OleDb.OleDbDataAdapter("Select * from demo where DateOfPurchase = '" + txtsdateofpurchase.Text + "'", Cnn)
Da.Fill(ds, "demo")
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()
End Sub
|
|
|
|
|
I don't use the tableadapters that often; it looks however as if you're continuously adding records. Try clearing the datasource beforing filling.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I'm looking for a Control or example that works similar to the Excel Text Import Wizard. I would like to be able to open a text file in something like a text box and then draw lines where the data will be parsed into either a CSV file or Excel File. I've searched the internet and saw plenty of questions like this but never a answer.
Thanks
|
|
|
|
|
Member 7743805 wrote: I've searched the internet and saw plenty of questions like this but never a answer.
Because it's not a question, it's a request for code. There's no built-in mechanism to do this, so somebody will have to write it. Those who did, don't like sharing their code for obvious reasons.
So, my first question would be; are you planning on writing one (in which case I can provide hints on how), or just looking for a free implementation?
There are a lot of tutorials on importing CSV-files, and MSDN has explanation on a custom Paint-event.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I started writing one and would appreciate any tips you can point me to.
I was hoping maybe there was a custom control even if it was commercial. I really would like to use a fixed font like Courier.
I would like to put a ruler vertical and horizontal around a textbox with a text file loaded into it. Then mark the columns and return the position of each marked. Also would like to be able to mark the vertical to possibly exclude certain sections.
Then these could be setup and saved by the user as templates so that each time they get these text file it would be defined for them. Since each could be a little different.
The vertical lines would be used to wipe out any sections with headers or footers in the text files that are being sent. This would need to return the row of the data.
Again any hints, tips, or tricks would be great.
|
|
|
|
|
Member 7743805 wrote: I really would like to use a fixed font like Courier.
Each control has a Font property.
Member 7743805 wrote: I would like to put a ruler vertical and horizontal around a textbox with a text file loaded into it.
I'll bet that CodeProject has an article on that. And yes, this was the first result[^] according to Google.
Member 7743805 wrote: <layer> Then mark the columns and return the position of each marked.
You can easily determine the location of the cursor, and MSDN has an example on owner-drawn painting.
Member 7743805 wrote: Then these could be setup and saved by the user as templates so that each time they get these text file it would be defined for them.
..not in a standard control. Again, "someone" will have to write it. Yes, there are examples out there, but there's little chance that there's a control that satisfies all your wishes.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi guys ,
I have tried to make a parametric report in visual studio 2010 by using VB.net, but i haven't done yet.
can anybody help me how to do this ?
|
|
|
|
|
hi, guys i have function for get multi values from a datareader
is working fine but when i have two or more data only i can get the las register
how i can get all register ??
Public Class OracleDataClass
Public ORAVALUEA As String
Public ORAVALUEB As String
Public ORAVALUEC As String
Public ORAVALUED As String
End Class
Function OracleQuerys(ByVal orasql_query As String, ByVal ORAVALUEA As String, ByVal ORAVALUEB As String, ByVal ORAVALUEC As String, ByVal ORAVALUED As String) As OracleDataClass
Try
Dim OracleGetInfo As New OracleDataClass
Dim OracleDataClass As
orasql_querys = orasql_query
oracle_cmd_command = New OracleCommand(orasql_query, conoracle)
oracle_data_reader = oracle_cmd_command.ExecuteReader
While (oracle_data_reader.Read())
OracleGetInfo.ORAVALUEA = oracle_data_reader.Item(ORAVALUEA)
OracleGetInfo.ORAVALUEB = oracle_data_reader.Item(ORAVALUEB)
OracleGetInfo.ORAVALUEC = oracle_data_reader.Item(ORAVALUEC)
OracleGetInfo.ORAVALUED = oracle_data_reader.Item(ORAVALUED)
End While
Return OracleGetInfo
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
oracle_data_reader.Close()
End Function
Dim GetDataOracle As OracleDataClass = OracleQuerys(orasql_query, ORAVALUEA, ORAVALUEB, ORAVALUEC, ORAVALUED)
client_product_number = GetDataOracle.ORAVALUEB
client_phone_number = GetDataOracle.ORAVALUEC
thanks for the help and time
|
|
|
|
|
Yes, that will onyl return the last value read because you're storing every single value in the same single-valued variables, overwriting the values from the previous pass through your While loop.
You have to use some List variant or arrays to return more than one set of values.
|
|
|
|
|
ok nice i will use a Array thanks
|
|
|
|
|
look this my array
Function OracleQuerys(ByVal orasql_query As String, ByVal ORAVALUEA As String, ByVal ORAVALUEB As String, ByVal ORAVALUEC As String, ByVal ORAVALUED As String) As ArrayList
Try
Dim OracleGetInfo As ArrayList = New ArrayList
orasql_querys = orasql_query
oracle_cmd_command = New OracleCommand(orasql_query, conoracle)
oracle_data_reader = oracle_cmd_command.ExecuteReader
While oracle_data_reader.Read()
OracleGetInfo.Add(oracle_data_reader(ORAVALUEA))
OracleGetInfo.Add(oracle_data_reader(ORAVALUEB))
OracleGetInfo.Add(oracle_data_reader(ORAVALUEC))
OracleGetInfo.Add(oracle_data_reader(ORAVALUED))
End While
Return OracleGetInfo
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
oracle_data_reader.Close()
End Function
i get the Data in the fills but how i can pass for example to varible call Name? on on ORAVALUEA
Thanks for your time and help
|
|
|
|
|
You REALLY need to pickup a beginners book on C#. You're just guessing at how this stuff works and wondering why it doesn't. You don't have the faintest idea of how these basic constucts work.
Create a class or structure to hold the items for one record. Then you can add that to a List and return that instead.
|
|
|
|
|
ok, dude thanks for your time and help.. i will check the book
thanks alot!
|
|
|
|
|
I Have A Form Called Invoice And Has A Data grid view That Contains The Details Of the Specific Invoice
One Field In The Invoice Details Data grid view Called ItemIndex
So When user Enters An UnExisted ItemIndex An Error occurs With Message "Item Not Found" So I Created Another Form When This Error Occurs A Form Called Item List Opens With A List Of The Available Items So When The User Clicks On An Item The Info In That Specific Row Should Be Transferred to Invoice Details Datgridview In The Invoice Form
The Item Index Form Can Be Called From More Than One Form In The Application As The Item Index Help
Can Be Requested From Purchased Or Transfer Forms.....
Can Anyone Help With This Issue Please ?????
Many Thanks In Advance
|
|
|
|
|
BTW it's pretty rough to understand what you mean at all. Why not use punctuation and normal writing style to make it easier for someone who wants to help???
As far as I understand you want to transfer a row from one DataGridView to another. I didn't test that, but – assuming they have the same set of columns – I'd consider to transfer the relevant row from the DateGridView's DataSource (dataset / table) to the other grids DataSource.
|
|
|
|
|