Question : How do I Write a VB app to execute a stored procedure and a Crystal Report

Hi,

I'm very new to VB and Visual Studio but I know what I want to acheive and have already written the underlying SQL Stored Procedure and the Crystal Report to produce the output reports required by my company. Just need to make a user friendly program to run it.

What I'm trying to do is this :-

Make a Visual Studio Solution that reads a SQL table to give a list of part numbers to the app which the user chooses one, they then enter No. of cards to be printed. Both values are then used as parameters to execute a SQL Stored procedure (already written and tested) which populates a SQL table from which the Crystal Report Reads the records to produce the desired output from the printer.

So in order
1) Choose part number in Visual Studio app (from SQL data lookup in a listbox or combobox)
2) enter number of labels into Visual Studio app (text box ?)
3) Stored procedure uses the chosen values to make data records in a table on the same server- so pass the values from items 1 & 2 to the Stored Procedure
4) Crystal Report Envoked from Visual Studio App to print the records created in the table from item 3
5) App closed no data saved as Stored Procedure clears data table on next execution

Both SP, datatables and Crystal ODBC links to the same SQL Database

Any help appreciated in acheiving my goal,

Answer : How do I Write a VB app to execute a stored procedure and a Crystal Report

Open Visual Studio and create a new ASP.NET Web Application

1)  Open Default.aspx and drag and drop a Drop Down List on the page and click the ">" smart tag.  Select "Choose Data source" and select and enter your relevant information for a SQL Data Source.  Right click the control, select properties and give it a friendly ID that you can remember, eg.  ddlPartNumber

2)  Drag and drop a textbox on the page and right click and select properties.  Give it a friendly ID, eg. txtNumberOfLabels

3,4)  Drag and drop a gridview onto the web page (first view the data, you can do the report later).  Select the smart tag and choose datasource.  Select SQL Datasource and select your stored procedures.  Wire up the variables to the drop down list and the textbox IDs.

5).  Press F5, click yes to enable debugging and test your app.

If you want more detailed video tutorials, head over to http://www.asp.net/learn/
Random Solutions  
 
programming4us programming4us