I have a task to work for MVC using ADO.NET.Can we do this using normal ADO.NET?If possible some helpful links.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At first, it not possible with
rawADO.NET without using some kind of containers for data like DataSet.The reason is providing model from action method and querying this model from inside view has different scope. View accesses model after action method is exit. Consider following code sample:
When view tries to access reader, reader is already disposed. So some kind of container is required.
For other things you can pass command parameter values as action parameters, and use ViewState for passing additional data to view without using typed models. This is not a problem but it needs more effort rather than regular models.