Operations in a relational database act on a complete set of rows. This complete set of rows returned by the statement is known as the result set. Sql server Cursor is a database objects to retrieve data from a result set one row at a time, instead of the T-SQL commands that operate on all the rows in the result set at one time. We can use cursor when we need to update records in a database table row by row. In this article we will see how to use Sql Server Cusror with Example.
In Entity Framework to delete an Object, we first fetched the object and than delete that particular object or record. This one result in to performance penalty as there are two SQL query executed first one for “Select” query and second one for “Delete” query. In Entity Framework 6.0 or above Microsoft provide solution to delete an object(record) with out retrieving or fetching it.
In Sql server if we want to be sure that specific column exists in given database table or not than you can check either manually or using query for large number of columns of table. In this tutorial we will see how to check if column exist in database table.
In this article we will see that how to upload a file in Asp.net MVC as well we go through different different criteria like single file upload, multiple files upload and strongly type viewmodel file upload in MVC.
Recently I have faced this question in interview that how to add or insert multiple rows in a single query at once. So I have find out two different solutions for this query. Let’s see the solutions.
Frequently in interview we face the question that how to get Host name(machine name), Server name, User name and DataBase name of Sql Server which are connected in Networks. In this article we will see that how to find Host name(machine name), Server name, User name and DataBase name using Sql select query in Sql Server management studio which is quite easy.
Today in this article we will see how to render razor view or partial view to string in Asp.net MVC. View or partial view contains generally html tags and razor syntax, if we can convert view into string using C# than we can pass string as a Json Result from controller to view(for Ajax call). Let’s see sample code.