Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

MVC and ADO.Net

$
0
0

Hi Friends,

I am trying to do something I would think would be extremely easy. Maybe I have got so used to using the entity framework, but I just want to return data from a stored procedure that receives one parameter usining plain old ADO.NET. I dont know what in the world I could be doing wrong but should I enclose the name of my stored procedure in brackets within the SqlCommand like this var command =newSqlCommand("[dbo].[spGetSSN]", connection) or remove the brackets? And is this how I add a parameter to the stored procedure...... command.Parameters.Add(newSqlParameter("ssn", model.SSN)); or do I need a @ sign before the ssn like @ssn? This seems extremely simplistic but for some reason it's not working. Thanks for any HELP !!!


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>