|
How about something like Option #2, but in a Temp table.
Something like
SELECT xdate,description,income_amt Into #Temp1
Union
SELECT xdate,description,exp_amt Into #Temp1
(Apply the correct field names for your solution)
This way, you have a merged table which you can sort by date and generate your report.
My 2 cents.
|
|
|
|
|
Option 2 without the merge. Use subreports in Crystal Reports, one for income and one for expenses. This also allows you to put the tables side by side. The only disadvantage might be if you want to show a net profit/loss, though this could be handled easily by pre-calculating and passing in as a formula field.
"Go forth into the source" - Neal Morse
|
|
|
|
|
I Need to load data from SQL server. i wrote this. Can anyone help me please.
I have:
txt.ID
txt.Name
txt.Adress (as textboxes)
cbDept (as a combobox)
The textboxes stays empty. and in the combobox i get the ID, and in the combobox i need to get the name.
Private Sub cmdRequery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRequery.Click
DBRequery()
Me.BindingContext(_DataSet.Tables(0)).CancelCurrentEdit()
Me.BindingContext(_DataSet.Tables(0)).Position = 0
RefreshData(True)
End Sub
Private Sub DBRequery()
cmdSave.Enabled = False
_DataSet.Clear()
Try
_DataAdapter.Fill(_DataSet)
Catch Eror As Exception
cmdAdd.Enabled = False
cmdUpdate.Enabled = False
cmdDelete.Enabled = False
MsgBox(Eror.Message, MsgBoxStyle.Exclamation, "Error Opening Database")
Close()
Exit Sub
End Try
txtCount.Text = Format(_DataSet.Tables(0).Rows.Count, "#,##0")
If _DataSet.Tables(0).Rows.Count > 0 Then
txtCurrent.Text = "1"
EnableNavigation()
End If
cmdAdd.Enabled = True
End Sub
Thank you
|
|
|
|
|
I wrote this on form load. But none of them is working.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strconnection As String = "Data Source=ELIANE-VAIO\SQLEXPRESS;Initial Catalog=DatabaseConnection;Integrated Security=True;"
Dim _cn As SqlConnection = New SqlConnection(strconnection)
_cn.Open()
cmd.Connection = _cn
_DataAdapter.SelectCommand = New SqlCommand("SELECT * FROM tblCustomer", _cn)
Try
_DataAdapter.Fill(_DataSet)
Catch eror As Exception
MsgBox(eror.Message)
End Try
cbDept.DataSource = _DataSet.Tables(0)
cbDept.DisplayMember = "Namee"
cbDept.ValueMember = "DeptID"
Me.txtName.Text = ""
txtName.DataBindings.Add("text", _DataSet.Tables("tblCustomer"), "Name")
txtEmail.DataBindings.Add("text", _DataSet.Tables(0), "Email")
txtAddress.DataBindings.Add("text", _DataSet.Tables(0), "Address")
cbDept.DataBindings.Add("text", _DataSet.Tables(0), "Namee")
End Sub
|
|
|
|
|
Member 10388494 wrote: I wrote this on form load. But none of them is working. Which "them"? And what do you mean by "not working"? Does it throw an error, does it show a blank form?
Put a breakpoint after that try, and hover the mouse over the word "_DataSet" to inspect it's values; see if there are records in the dataset. If not, verify whether you're selecting from the correct database.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I tried. And it worked.
Private Sub BindingContext_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim strconnection As String = "Data Source=ELIANE-VAIO\SQLEXPRESS;Initial Catalog=DatabaseConnection;Integrated Security=True;"
_cn = New SqlConnection(strconnection)
Dim da As New SqlDataAdapter("select * from tbldept", _cn)
Dim ds As New DataSet
da.Fill(ds, "tbldept")
cbDept.DataSource = Nothing
cbDept.Items.Clear()
cbDept.DataSource = ds.Tables("tbldept")
cbDept.DisplayMember = "namee"
cbDept.ValueMember = "deptid"
If cbDept.Items.Count <> 0 Then
cbDept.SelectedIndex = 0
cbDept.SelectedValue = 0
cbDept.Text = ""
End If
ds.Dispose()
da.Dispose()
_DataAdapter = New SqlDataAdapter("select * from customervw", _cn)
_DataAdapter.Fill(_DataSet)
txtName.DataBindings.Add("text", _DataSet.Tables(0), "Name")
txtEmail.DataBindings.Add("text", _DataSet.Tables(0), "Email")
txtAddress.DataBindings.Add("text", _DataSet.Tables(0), "Address")
cbDept.DataBindings.Add("text", _DataSet.Tables(0), "Namee")
txtserial.DataBindings.Add("text", _DataSet.Tables(0), "serial")
txtCount.Text = _DataSet.Tables(0).Rows.Count
End Sub
|
|
|
|
|
Hello guys. I need your help Please. I have this code.
Private Sub cmdDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDelete.Click
BindingContext(_DataSet.Tables(0)).RemoveAt(BindingContext(_DataSet.Tables(0)).Position)
txtCount.Text = CStr(CInt(txtCount.Text) - 1)
RefreshData(True)
cmdSave.Enabled = True
End Sub
I want to delete a record from my database.
The record is being removed from the form. but not from the database.
Any suggestion?
Thank you
|
|
|
|
|
That is because you are doing only half the job, you update the datasource collection but nowhere do you delete the record from the database. Whatever you are using as a tutorial/book/learning aid should have this information. It is impossible to guess your DAL methodology.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi everyone
I was able to load a pdf into a picturebox and save it into a table using data type varbinary successfully.
I load the table with the pdf file onto a form with a picturebox control.
now i want to doubleclick the picturebox to view the pdf file.
I tried few things, don't seem to work out.
Guide me on this one.
Thanks
|
|
|
|
|
You need a PDF Viewer[^]
When will you people learn to do a basic bit of research before posting a question?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for replying,
But my problem still exists.
The problem is is not loading the pdf file into a pdf reader through an Adobe PDF Reader.
But rather doing the following scenario
Here is the scenario again
1) Have a form (PDF_file)
2) A picturebox (pdf_filePictureBox)that bides with a table with datatype varbinary(Max)
3) (PDFPicture) The Adobe PDF Reader control to load the PDF.
4) A load_button to load the PDF into the reader.
5) An Open_button to read the PDF from the pdf_filePictureBox after being save into the sql database
Now I need to take the pdf showing in the acrobat read and put it in the pdf_filePictureBox so that it can be saved. and load it from the database while I can click open to read it back into the acrobat reader.
I know I need to convert it as a tiff file and put it in the picturebox. unable to get it to work.
This what I've done thus far:
.....
pdf_fielPictureBox.Hide()
PDFPictureBox.Loadfile(openFileDialog.filename)
PDFPictureBox.Show()
.......
This is what I want to accomplish..your guidance is most welcome on this issue.
Thanks again..Hope I am more clearer on my issue.
-- modified 19-Dec-13 12:24pm.
|
|
|
|
|
Hi Good morning to All.
I developed & deliverd a Billing application in VB6 with built in data report for printing. Everything is fine. But the problem is My Client using dot matrix printer (TVS MSP 240 Star). They are using paper roll for printing. The printer ejacts much paper after printing the data. My paper size is 4.5*3.5 inches. I expect the printer must stop after printing the last line (may be 3 or 4 lines). But it ejacts the whole 3.5" paper. And it does not reverse the paper for next printing. Please help me.. Thanks in advance...
|
|
|
|
|
Hi all,
For last three days, I am getting confused by thinking of a logic.
Ok, let me tell you the confusion.
I am developing an Inventory Software of a Retailer. There are 3 involved here. Like
------------- Sale ----------- Sale -----------
| | -------> | | -------> | |
| Distributor | | Retailer | | Customer |
| | <------- | | <------- | |
------------- Return ----------- Return -----------
The above diagram is to make you understand the workflow.
1. Distributor sold to Retailer
2. Retailer sometime return the goods to Distributor for breakage. This can be single item/product or the entire invoice.
Same,
3. Retailer sold to Customer.
4. Customer sometime return the goods to Retailer for breakage. This can be a single item/product or the entire invoice.
My confusion is how should I maintain the stock quantity ?
|
|
|
|
|
This is not a software problem but a business decision, you need to talk to your business and find out how they treat the returned product but I can see at least 2 possibilities. The returned product is either able to be resold or it is rubbish, and those are only the 2 extremes.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Holmes,
Thanks for your answer. Yes the returned product can be resold. I mean sometime the retailer by mistake sales over quantity product to the customer and same Distributor. Like....
Suppose a product name is ItemA.
1. Customer need 3 ItemA.
2. Retailer (by mistake) sold 4 ItemA and generate Invoice.
3. Customer wants to return the excess ItemA (i.e. 1 qty.) to the retailer.
4. Retailer returns 1 ItemA and returns the ItemA value to the customer and generate a Credit/Return Note.
Same thing happens between Distributor and Retailer.
Yes, it is business decision and I have to implement it.
So, I just want to know "What should be the logic and how could I implement ?"
|
|
|
|
|
I would think there is only 1 thing you can do if the product is going to be returned, increment the stock on hand and credit the retailer for the product.
How you do that in your system is not something we can define for you, any "logic" will be based on the internals of your application and the business logic you need to implement.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Holmes,
Thanks for your reply. I have already implemented something. Please tell me is this ok or not.
1. Save the returned product data with rate, tax, discount everything in SalesReturn table.
2. Increment the stock that customer returned in stock table.
3. Generate Credit Note with all details of returned product.
Are there anything more to do ?
|
|
|
|
|
While it seems reasonable, you and the business are the only people who can answer this question. If you are developing this in isolation, without guidance from the actual business, then you are going to fail. You need to get guidance from the business who are expected to implement this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I want to make an windows 8.1 store app(can be desktop but prefer store).
I know the following languages :
visual basic 2012(win rt)(mostly preferable)
visual c++( not good)
i have to make the beta fast
PROGRAM:-
->a interactive full screen homepage with 3 buttons and settings in the charm bar
HOME PAGE buttons:-
->1st button: record screen: records the desktop and other win 8 apps with webcam support and audio from mic
->2nd button: Edit video: more like mixing. you can drag-drop video to timeline(like windows movie maker) and 2 channel audio(one for voice and one for song)
->3rd button: upload video: push the video to the web as mp4 or avi at youtube or facebook or save them to disk
VOICE RECOGNITION:-
(optional) at the home screen when user say some command like 'program run record' or 'program edit video', the program does the same.
i want some leads...i have no experience in intensive, professional programming but i want to do so.
i would really appreciate if you tell me what i have to do,
specifically:
things that are easy,
things that need some stress
and work on!
Thanks in advance
|
|
|
|
|
|
hey
i am looking for a appointment scheduler in visual basic 6
like the outlook calander appointment
i found here but it is in vb net or c# and i only know
visual basic 6
if somebody have something like this i will appriciate it
have a good day
|
|
|
|
|
|
i see that
now what?
i posted my question ok i think
|
|
|
|
|
Then you must have missed point 2. If you want code then you will need to go and look for it yourself. These forums are for technical questions.
Veni, vidi, abiit domum
|
|
|
|
|
i am just looking for some help
i found a vb net code and i know only vb 6
|
|
|
|