SQL Server & VB.Net issues with stored procedures -


  • sql server 2008 r2
  • visual studio 2010

i have 2 tables: first table countries has 3 columns country-id, countryname, cityname.

i displaying country name , city name dropdownlist in visual studio.

my second table name userselection columns id, country-id, username, date

i created form on visual studio has button send information sql server through stored procedure.

my stored procedure far is

set ansi_nulls on go set quoted_identifier on go  alter proc [dbo].[usp_userinput]     (@country-id int,      @username(75),      @date datetime)     insert [customapplications].[dbo].userselection ([country-id], [username], [date])     values (@country-id, @username, @date) 

however when send says many arguments , think because trying send countryname , cityname rather country-id. on how create stored procedure send country-id , still have values populate dropdownlist countryname, cityname.

thanks

remove - symbol variable name. sql server thinks trying math. need put data type @username variable.

use [countryapplications] go /****** object:  storedprocedure [dbo].[usp_userinput]    ******/ set ansi_nulls on go set quoted_identifier on go  alter proc [dbo].[usp_userinput] (@countryid int,  @username varchar(75),  @date datetime)   insert [customapplications].[dbo].userselection ([country-id], [username], [date])  values  (@countryid, @username, @date) 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -