Click here to Skip to main content
15,897,187 members

Comments by Member 14976615 (Top 2 by date)

Member 14976615 17-May-21 23:30pm View    
Hi, Can you please help me out to figure the Error please. this is my dataset link"https://drive.google.com/file/d/1m8CTh0S594saqtD2UaQwqpq6HFy-nVHB/view?usp=sharing". I have no idea about this i am very new in this field.I have tried to find through command window (GetError) but no use.Please Help me
Member 14976615 15-May-21 13:00pm View    
Hi,

Can you please give me a solution for my second error pls:This is my code to Generate the Report:

Try
Cursor = Cursors.WaitCursor
Timer1.Enabled = True
Dim rpt As New rptVoucher
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand()
Dim myDA As New SqlDataAdapter()
Dim myDS As New SchoolmanagementDataSet
myConnection = New SqlConnection(cs)
MyCommand.Connection = myConnection
MyCommand.CommandText = "Select Pettycash.ID,Pettycash.Pettycashno,Pettycash.Date,Pettycash.Accountno,Pettycash.Accountname,Pettycash.Amount,Pettycash_Details.VD_ID,Pettycash_Details.Accountname,Pettycash_Details.AccountNo,Pettycash_Details.Billref, Pettycash_Details.Narration, Pettycash_Details.Amount FROM Pettycash INNER JOIN Pettycash_Details On Pettycash.ID = Pettycash_Details.VoucherID where Pettycashno='" & txtVoucherNo.Text & "'"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
'myDS.EnforceConstraints = False
myDA.Fill(myDS, "Pettycash")
myDA.Fill(myDS, "Pettycash_Details")
rpt.SetDataSource(myDS)
frmReport.CrystalReportViewer1.ReportSource = rpt
frmReport.ShowDialog()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub



This is my DataTable-1:
CREATE TABLE [dbo].[Pettycash] (
[ID] INT NOT NULL,
[Pettycashno] NCHAR (30) NULL,
[Date] DATE NULL,
[Accountno] NCHAR (150) NULL,
[Accountname] NCHAR (150) NULL,
[Amount] DECIMAL (18, 2) NULL,
[rnumber] NCHAR (150) NULL,
CONSTRAINT [PK_Pettycash] PRIMARY KEY CLUSTERED ([ID] ASC)
);




This is my DataTable-2;
CREATE TABLE [dbo].[Pettycash_Details] (
[VD_ID] INT IDENTITY (1, 1) NOT NULL,
[VoucherID] INT NULL,
[Date] DATE NULL,
[Accountname] NCHAR (150) NULL,
[AccountNo] NCHAR (150) NULL,
[Billref] NVARCHAR (50) NULL,
[Narration] NVARCHAR (MAX) NULL,
[Amount] DECIMAL (18, 2) NULL,
[rnumber] NCHAR (150) NULL,
CONSTRAINT [PK_Pettycash_Details] PRIMARY KEY CLUSTERED ([VD_ID] ASC),
CONSTRAINT [FK_Pettycash_Details_Pettycash] FOREIGN KEY ([VoucherID]) REFERENCES [dbo].[Pettycash] ([ID]) ON DELETE CASCADE ON UPDATE CASCADE
);



This is my DataSet Download Link;
https://drive.google.com/file/d/1m8CTh0S594saqtD2UaQwqpq6HFy-nVHB/view?usp=sharing