を供給していなかった私は、このエラーを取得しておく、私は、Visual Studio 2016およびMicrosoft Management StudioのSQL Serverと働いている2016年プロシージャまたは関数「procMakeTimeSlotは」パラメータを期待「@userFriendlyErorrMessage」、
プロシージャまたは関数 'procMakeTimeSlot'は、パラメータ '@userFriendlyErorrMessage'を要求しますが、これは指定されていません。
と
command.ExecuteNonQuery(); //.Net says anything not select operation is a non query
create proc procMakeTimeSlot
(
@appointmentId int,
@appointmentSlotId int,
@userFriendlyErorrMessage varchar(100) output
)
as
begin
declare @successfulInsert bit;
begin try
insert into ApptTimePeriod
(AppointmentId, AppointmentSlotId)
values
(@appointmentId, @appointmentSlotId)
set @userFriendlyErorrMessage = 'Successful';
set @successfulInsert = 1;
end try
begin catch
--primary key error
if (ERROR_MESSAGE() like'%pkApptTimePeriod%')
set @userFriendlyErorrMessage = 'Appointment has already been added to the time slot'
if(ERROR_MESSAGE() like
'%fkAppointmentTimePeriodToAppointmentSlot%')
set @userFriendlyErorrMessage = 'Invalid Time Slot';
if(ERROR_MESSAGE() like '%fkAppointmentTimePeriodToAppointment%')
set @userFriendlyErorrMessage = 'Invalid Appointment';
if(ERROR_MESSAGE() like '%chSlotsLeft%')
set @userFriendlyErorrMessage = 'No time Slots Available';
set @successfulInsert = 0;
end catch
return @successfulInsert;
end
/*
declare @userFriendlyErorrMessage varchar(100);
execute procMakeTimeSlot
@appointmentId = 10005,
@appointmentSlotId = 100,
@userFriendlyErorrMessage = @userFriendlyErorrMessage output;
print @userFriendlyErorrMessage;
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="FindServiceAvailability.aspx.cs" Inherits="VehicleServiceWebAppMcConnell.FindServiceAvailability" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<asp:Calendar ID ="calStartDate" Caption ="Choose start date (optional)" runat="server" />
<asp:Calendar ID ="calEndDate" Caption ="Choose end date (optional)" runat="server" />
<asp:Button ID ="btnFindServiceAvailability" Text ="Find Service Availability" runat ="server" OnClick="btnFindServiceAvailability_Click" />
<asp:GridView ID ="gvAvailableServiceTimes" Caption = "Available Service Dates and Times" runat ="server" AutoGenerateColumns ="False" EmptyDataText = "No availability for requested date/time" >
<Columns>
<asp:TemplateField HeaderText ="Select Date and Times">
<ItemTemplate>
<asp:CheckBox ID ="cbSelectedDateTime" runat = "server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField ="AppointmentSlotId" HeaderText ="Appointment Slot ID" />
<asp:BoundField DataField ="ApptDate" DataFormatString = "{0:d}" HeaderText ="Available Date" />
<asp:BoundField DataField ="ApptTime" HeaderText ="Start Time" />
</Columns>
</asp:GridView>
<asp:Button ID ="btnMakeAppointment" Text ="Make Appointment" runat ="server" OnClick="btnMakeAppointment_Click" />
<asp:Label ID ="lblResultMessage" runat ="server" />
</asp:Content>
あなたの.Netコードはどこですか?あなたは@userFriendlyErorrMessageのために何を渡していますか? – Seano666
私はAppointmentSlotIdがprocMakeTimeSlotのMicrosoft管理スタジオ(SQL)の自分の手続きで正しく入力されていることを知っています – Student
私の視覚スタジオコードを見る必要があるかどうか教えてください。あるいは、ソリューション全体でさえ、私の友人の非常に小さなエラーが、私がvarcharとしてuserfriendlyerrormessageを宣言しなければならないと言いましたが、私はすでにそれを行っていますか?多分私はビジュアルスタジオでそれをやる必要がありますか? – Student