muskdial 0 Newbie Poster

Hi everyone

This is my first post so please help me out !! ;)

I am writting an application in VB.NET to print orders. The orders are shown on screen in a listview and the user can select individual orders/range of orders to print.

This Access query looks like:

PARAMETERS OrderIds Text ( 255 );
SELECT orders.*, orderdetails.*
FROM orders, orderdetails
WHERE orders.orderid=orderdetails.orderid And orders.orderid IN (OrderIds);

How do I from vb.net pass the OrderIds parameter into this query with mulitple orderids?

e.g. passing "123-456" works
passing " '123-456', '123-789' " doesn't.

Thanks

Darren

Hi Darren
I'm not sure I can answer your question but I wrote an application for
Coumadin Dosing / Database where I use Crystal Reports to print out
my records. Take a look at my web site http://www.pace-med-apps.com/Warfarin2.aspx
near the middle of the page. If this looks like some thing that may be helpful
then email me drp@spmd.us

Take Care
Scott

muskdial 0 Newbie Poster

Thanks for replying preetham.

I'm not sure what I'm going to use to store my data yet. Is SQL server something that comes with Visual Studio 2005? I'm really not clear on this.
With the datagrid I need to be able to let the user manipulate the data in each individual cell by subtracting a certain amount from it. The amount that is subtracted will be moved and stored somewhere else and the cell on the datagrid should show what is left. Is this something that can be done with the datagrid?

Thanks,
David

Hello
I think you should be able to do it with Access database. Only part of the code below:

Dim cf1, cf2, cf3, cf4, cfr1, cfr2 As Double
Dim ccf1, ccf2, ccfr1, ccfr2 As DataGridViewCell
Private Sub CalculateCubic1()
If grdClublic.Rows.Count > 0 Then
rowindex = grdCublic.CurrentCell.RowIndex
Dim row As DataGridViewRow = grdCublic.Rows(rowindex)
ccf1 = row.Cells(0)
ccf2 = row.Cells(1)
ccf3 = row.Cells(2)
ccf4 = row.Cells(3)
ccfr1 = row.Cells(4)
ccfr2 = row.Cells(5)
crecno = row.Cells(6)

cf1 = CDbl(ccf1.Value)
cf2 = CDbl(ccf2.Value)
cf3 = CDbl(ccf3.Value)
cf4 = CDbl(ccf4.Value)
cfr1 = CDbl(ccfr1.Value)
cfr2 = CDbl(ccfr2.Value)
end sub
private sub CalcCubic2()
call CalcCubic1()
cfr1 =cf2 - cf1
cfr2=cf4-cf3
end sub
Then update your database and refill your grid. Every time a value is changed the database would need to be updated and …

muskdial 0 Newbie Poster

Dear frens,

I have made an application in VB.net using Visual studio 8, with ms access as a backend.

I have crystal report installed in it. I have got a problem while connecting database to the crystal report. I have also got problem in designing part. Is there any solution for it.

And the other part is that I also tried to make a report viewer througn database report viewer. But it showed certain problem .It showed report of only one row at one time and the report cannot be exported to word file.

Is there any solution for it.

I m in immense trouble.

Please help me

Waiting .....

Kshiteesh

Hello
The only work around that I have found to work was to change your connection string (I use Access as a database):
Instead of -
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Application.StartupPath & "\Database.mdb"
I had to use -
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"C:\Database Folder\Database.mdb"
You will manually place the database in a folder labeled Database Folder (or whatever) on the C Drive.
This allows both your application and Crystal Report to have access to the database. You will then have to go back to Crystal Reports/Database/Set Datasource Location then choose "C:\Database Folder\Database.mdb". This will allow your CR to access your database and changes in the database will be viewed immediately in the CR while the application is running.
Hope this helps
Scott

muskdial 0 Newbie Poster

Nice work though! keep posting.

Thanks for the encouragement, Binoj!
Scott

muskdial 0 Newbie Poster

Hi,
I went through your code and there is an easier way to calculate the no. of years. You can simple use a builtin DateDiff function which takes Date1 and Date2 as paramters along with some other settings.

Hello
Actually if you check my code under the button "Less Accurate" you will see I did just that with the code:
Dim d1 As Date
Dim d2 As Date
d1 = Now
d2 = dtpDOB.Value
Dim iage As Integer
iage = DateDiff(DateInterval.Year, d2, d1)
txtAge.Text = CStr(iage)

This code is far less accurate.
Scott

muskdial 0 Newbie Poster

Hello

My name is Scott and I'm a physician and software developer. I'm new to this web site so please be patient if I'm not doing things properly. I write a lot of applications where I frequently need to calculate a patient's age based on their date of birth. I tried to find good examples but in the past have failed so to make a long story short I have developed a complete application to calculate age and I'm enclosing a zipped copy for anyone to try. Please feel free to send comments to my email me drp@spmd.us. A copy can also be downloaded from my web site http://www.pace-med-apps.com/freeCode.aspx

Thank you
Scott E Pace MD