Click here to Skip to main content
15,891,423 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Paste in next available row Pin
Eddy Vluggen6-May-14 7:42
professionalEddy Vluggen6-May-14 7:42 
GeneralRe: Paste in next available row Pin
David Rubin6-May-14 7:46
David Rubin6-May-14 7:46 
GeneralRe: Paste in next available row Pin
Eddy Vluggen6-May-14 8:49
professionalEddy Vluggen6-May-14 8:49 
GeneralRe: Paste in next available row Pin
David Rubin6-May-14 11:22
David Rubin6-May-14 11:22 
GeneralRe: Paste in next available row Pin
Mycroft Holmes6-May-14 13:03
professionalMycroft Holmes6-May-14 13:03 
GeneralRe: Paste in next available row Pin
Eddy Vluggen9-May-14 5:21
professionalEddy Vluggen9-May-14 5:21 
GeneralRe: Paste in next available row Pin
David Rubin6-May-14 7:28
David Rubin6-May-14 7:28 
QuestionHow i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 7:47
professionaltastini5-May-14 7:47 
i have stored procedure with two parameters, one varchar and another one date format.

i am getting the error ,"Error converting data type nvarchar to datetime." like this while am running.

this is my code inside the vb,

VB
Public Sub Selecttable()
        sql.OpenDbConnection()
        Dim cmd As SqlCommand = New SqlCommand("SearchRecord", sql.SqlConn)
            cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@Date", "DateOfActivation")
        cmd.Parameters.AddWithValue("@Activation", "activation")

        Dim dt As New DataTable()
        Using da As New SqlDataAdapter(cmd)
            da.Fill(dt)
            dgvSearch.DataSource = dt
        End Using

    End Sub


and my storedprocudure like this...

USE [Activation]
GO
/****** Object: StoredProcedure [dbo].[SearchRecord] Script Date: 05/05/2014 21:24:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[SearchRecord]
@Activation nvarchar(50),
@Date datetime




AS
BEGIN
set dateformat yyyymmdd
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
SELECT * from Activation.dbo.tblActivationMain WHERE DateOfActivation=@Date AND Activated=@Activation
END


please help me to find the solution.
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
Wes Aday5-May-14 8:28
professionalWes Aday5-May-14 8:28 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 8:41
professionaltastini5-May-14 8:41 
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
ZurdoDev5-May-14 9:13
professionalZurdoDev5-May-14 9:13 
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
Eddy Vluggen5-May-14 8:44
professionalEddy Vluggen5-May-14 8:44 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 8:46
professionaltastini5-May-14 8:46 
QuestionRe: How i can use stored procedure in vb.net with two parameters Pin
Eddy Vluggen5-May-14 9:00
professionalEddy Vluggen5-May-14 9:00 
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 9:13
professionaltastini5-May-14 9:13 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
Eddy Vluggen6-May-14 7:38
professionalEddy Vluggen6-May-14 7:38 
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
ZurdoDev5-May-14 9:13
professionalZurdoDev5-May-14 9:13 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 9:18
professionaltastini5-May-14 9:18 
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
ZurdoDev5-May-14 9:26
professionalZurdoDev5-May-14 9:26 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 9:34
professionaltastini5-May-14 9:34 
QuestionRe: How i can use stored procedure in vb.net with two parameters Pin
ZurdoDev5-May-14 9:35
professionalZurdoDev5-May-14 9:35 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
tastini5-May-14 9:36
professionaltastini5-May-14 9:36 
AnswerRe: How i can use stored procedure in vb.net with two parameters Pin
ZurdoDev5-May-14 9:38
professionalZurdoDev5-May-14 9:38 
GeneralRe: How i can use stored procedure in vb.net with two parameters Pin
Dave Kreskowiak5-May-14 9:28
mveDave Kreskowiak5-May-14 9:28 
Questioncopying cells to another worksheet in next available cell per column Pin
David Rubin5-May-14 5:51
David Rubin5-May-14 5:51 

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.