Click here to Skip to main content
15,912,082 members
Home / Discussions / Database
   

Database

 
QuestionBest way to save data Pin
knappster30-Oct-06 1:43
knappster30-Oct-06 1:43 
QuestionADO.NET related question Pin
Imtiaz Murtaza30-Oct-06 0:57
Imtiaz Murtaza30-Oct-06 0:57 
AnswerRe: ADO.NET related question Pin
Colin Angus Mackay30-Oct-06 1:54
Colin Angus Mackay30-Oct-06 1:54 
GeneralRe: ADO.NET related question Pin
Damodar Periwal31-Oct-06 10:14
Damodar Periwal31-Oct-06 10:14 
AnswerRe: ADO.NET related question Pin
Hunuman30-Oct-06 2:02
Hunuman30-Oct-06 2:02 
GeneralData Type Issue in Where Clause Pin
Brady Kelly30-Oct-06 0:13
Brady Kelly30-Oct-06 0:13 
JokeRe: Data Type Issue in Where Clause Pin
Rob Graham30-Oct-06 3:14
Rob Graham30-Oct-06 3:14 
Questionselect query filling 2 typed datasets Pin
steve_rm29-Oct-06 22:10
steve_rm29-Oct-06 22:10 
Hello,

I have a query that select data from 2 tables which I want to print out in crystal report.

My query
<br />
ALTER PROCEDURE [dbo].[printJobSheet]<br />
@incidentID int<br />
<br />
AS<br />
BEGIN<br />
	-- SET NOCOUNT ON added to prevent extra result sets from<br />
	-- interfering with SELECT statements.<br />
	SET NOCOUNT ON;<br />
<br />
    -- Insert statements for procedure here<br />
	SELECT incident.incidentID, incident.company, incident.subject, incident.contact, incident.phoneNo, incident.email, incidentTask.TaskID, incidentTask.Details<br />
	FROM incident INNER JOIN incidentTask on incident.incidentID = incidentTask.incidentID<br />
	WHERE incident.incidentID = @incidentID<br />
END<br />


The repeating field are in the incidentTask table (TaskID, Details) These will be in the detailed section of the report. The other fields from the incident table will be in the header.

The way I am fill my dataset which is a typed dataset is as follows:
<br />
Try<br />
            cmd.CommandType = CommandType.StoredProcedure<br />
            cmd.CommandText = "printJobSheet"<br />
<br />
            Dim pIncidentID As New SqlParameter()<br />
            pIncidentID.ParameterName = "@IncidentID"<br />
            pIncidentID.DbType = DbType.Int16<br />
            pIncidentID.Direction = ParameterDirection.Input<br />
            pIncidentID.Value = IDNumber<br />
            cmd.Parameters.Add(pIncidentID)<br />
<br />
            DS_JobSheet2 = New DataSet<br />
<br />
            cnn.Open()<br />
            cmd.Connection = cnn<br />
<br />
            da.SelectCommand = cmd<br />
            da.Fill(DS_JobSheet2)<br />
<br />
            dt = DS_JobSheet2.Tables(0)<br />
<br />
            report.Load(Application.StartupPath & "/rptJobSheet2.rpt")<br />
            report.SetDataSource(dt)<br />
<br />
            Me.CrystalReportViewer1.ReportSource = report<br />
<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        End Try<br />


If I do a SELECT * FROM Incident
or
SELECT * FROM IncidentTask

It works, but not when I join the tables together. I have created the xsd typed datasets and have the in my report.

Can any confirm my query, is it correct.

Thanks in advance,

Steve
QuestionPurpose of SQL Server Jobs Pin
King Shez29-Oct-06 19:50
King Shez29-Oct-06 19:50 
AnswerRe: Purpose of SQL Server Jobs Pin
Eric Dahlvang30-Oct-06 3:13
Eric Dahlvang30-Oct-06 3:13 
Questionconnection cannot be made? Pin
Haoman1729-Oct-06 0:48
Haoman1729-Oct-06 0:48 
Questionconnecting to SQL express through ADO Pin
psasidisrcum28-Oct-06 11:54
psasidisrcum28-Oct-06 11:54 
AnswerRe: connecting to SQL express through ADO Pin
Jerry Hammond28-Oct-06 16:16
Jerry Hammond28-Oct-06 16:16 
GeneralRe: connecting to SQL express through ADO Pin
Colin Angus Mackay29-Oct-06 3:52
Colin Angus Mackay29-Oct-06 3:52 
GeneralRe: connecting to SQL express through ADO Pin
Jerry Hammond29-Oct-06 4:50
Jerry Hammond29-Oct-06 4:50 
GeneralRe: connecting to SQL express through ADO Pin
Colin Angus Mackay29-Oct-06 5:04
Colin Angus Mackay29-Oct-06 5:04 
GeneralRe: connecting to SQL express through ADO Pin
Jerry Hammond29-Oct-06 5:11
Jerry Hammond29-Oct-06 5:11 
AnswerRe: connecting to SQL express through ADO Pin
S Douglas29-Oct-06 1:55
professionalS Douglas29-Oct-06 1:55 
GeneralRe: connecting to SQL express through ADO Pin
Colin Angus Mackay29-Oct-06 3:56
Colin Angus Mackay29-Oct-06 3:56 
GeneralRe: connecting to SQL express through ADO Pin
S Douglas29-Oct-06 18:12
professionalS Douglas29-Oct-06 18:12 
AnswerRe: connecting to SQL express through ADO Pin
Colin Angus Mackay29-Oct-06 3:54
Colin Angus Mackay29-Oct-06 3:54 
QuestionSQLXML DiffGram question Pin
Diablo_m28-Oct-06 11:41
Diablo_m28-Oct-06 11:41 
QuestionRe: SQLXML DiffGram question Pin
Diablo_m28-Oct-06 21:42
Diablo_m28-Oct-06 21:42 
QuestionDeployment of managed UDTs - best approach in updating code in use? Pin
Mike Heffernan28-Oct-06 8:20
Mike Heffernan28-Oct-06 8:20 
QuestionSQL Server 2005. Pin
aditya chitti28-Oct-06 4:17
aditya chitti28-Oct-06 4:17 

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.