Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a view from C# code
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01615456
Message ID:
01615520
Vues:
50
>>>>>>>Hi,
>>>>>>>Can I create a view (dynamically) from C# code? Here is a simple example:
>>>>>>>DB has a table Equipment with the following columns:
>>>>>>>Eq_ID Char(15)
>>>>>>>Eq_Desc Char(40)
>>>>>>>IncInView Bit
>>>>>>>
>>>>>>>I need to make a call from C# (ASP.NET) and create a view that will have the following:
>>>>>>>Eq_ID
>>>>>>>Eq_Desc
>>>>>>>Only those rows that have InInView set to 1
>>>>>>>And name this view, for example, EQ_2015_02_17
>>>>>>>
>>>>>>>Ideally I would like this view to "auto destroy" the next day.
>>>>>>>
>>>>>>>TIA for any help.
>>>>>>
>>>>>>If you want to make an XML file, why not fill a data table with the columns you want and then write the XML file?
>>>>>
>>>>>This (making an XML file) is exactly what I am doing now in my VFP application. As I am converting it to ASP.NET, I thought that maybe creating a DB view would be a better approach.
>>>>
>>>>Yes, it probably would be a good idea to get rid of the XML file.
>>>>Why isn't a data table a good solution?
>>>
>>>I take my previous message back. I think there is an approach without XML file, and using the data table. Thank you for asking the question.
>>You're welcome.
>>I hope you're handling all that snow OK.
>
>Only 95" this year; piece of cake :). The banks of snow in my driveway are about 5' high now. As long as I can throw the snow over these banks I am ok :)

I bet sometimes you regret moving here from Russia ;-)

The good thing about New England winters is they pass. Eventually. This has been a bad one, though. My sister inherited our dad's house. It has a really long driveway, more like a road than a driveway. Her husband Richie clears it with a John Deere. There is no way you could shovel that much snow.

All the more reason to appreciate spring, the season of rejuvenation.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform