How to create SqlServer Views in ASP.Net C#,please forward few example programs.
How to use sqlserver views in asp.net C#?
HI
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 17, 2013, 8:05 PM EDT
hi,
SQL View is nothing but a virtual table whose contents are defined by sql query.
Example:
CREATE VIEW myEMPView
AS
SELECT e.EmpCode,u.userName FROM dbo.Users u
join employees e on e.empId = u.empId
you can use View in C# just as normal table.
DataTable t = new DataTable();
using (SqlConnection c = new SqlConnection(connectionstring))
{
c.Open();
using (SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM myEMPView", c))
{
a.Fill(t);
}
}
hope this will help you.