Foreign Key in Table Declaration CREATE TABLE ORDERS ( ID integer primary key, Order_Date datetime, Customer_ID integer references CUSTOMER(ID), Amount double); ALTER TABLE ORDERS ADD FOREIGN KEY (customer_id) REFERENCES CUSTOMER(ID); Stored Procedure Example CREATE PROCEDURE [dbo].[procedure_name] @param1 VARCHAR(100) ,@param2 VARCHAR(200) OUTPUT AS BEGIN DECLARE @param3 VARCHAR(100) SET @param3 = ‘ ‘ IF @param1 IS NOT …
Category: C# – Misc
Aug 21
ASP.Net Validation Control Examples in C#. #19
ASP.Net Validation Control Examples. Just check the code below Some note RequiredFieldValidator: is used to check that a field is filled up CompareValidator: Compare the value of a field with another field or data RangeValidator: Compares the data is within a given range RegularExpressionValidator: Domain name syntax, email addtress syntax ValidationSummary: Display all validation errors …
Aug 21
Simple Ajax Applications in C# (ASP.Net) #19
Simple Ajax Applications in C# (ASP.Net) If you are coming from PHP or Java Platform where you use JavaScript or JQuery to provide Ajax functionality, you still can use those strategies in ASP.net to provide Ajax functionality Check our short note on Ajax using JavaScript. In .Net, you just have to call the JavaScript function …
Aug 21
Random Notes and simple code on Developing Web Sites (Applications) in ASP.net using C# #19
Random Notes and simple code on Developing Web Sites (Applications) in ASP.net using C# The information below primarily apply to the web page model of web-development in C# _PageStart.cshtml runs at each page start/open _AppStart.cshtml runs at the beginning of the application Syntax to use the Layout file: @{Layout = “/Shared/Layout.cshtml”;} if you use this …
Aug 21
Razor, Web-page Model, Web-Application Development in C# #19
Razor, Web-page Model, Web-Application Development in C# Razor: a markup syntax to add server side code into ASP.net pages Razor example: Current time is @DateTime.Now Razor Code Syntax Single statement block @{ var message = “Hello World”; } Inline expression or variable The message: @message Multi-statement block @{ var greeting = “Hello”; var currentTime = …
Aug 20
Important Links for Mysql, PostGreSQL, Firebird, EnterpriseDB, Ingres #2
Firebird and postgresql:http://www.linuxjournal.com/node/7010 Important comment: easy to migrate from oracle to firebird than to postgre or mysql. From interbase to firebird will be better as they are similar. http://forums.devshed.com/firebird-sql-development-61/mysql–vs–firebird-sql-62269.html : Firebird is far better choice than mysqlAs for Performance, MySQL will outperform Firebird on almost all tests on local machine……On a Network Server a properly …
Aug 20
Creating and Consuming XML Web Services #24
visual studio .net -> File Menu -> new project -> Visual Basic/C# projects -> ASP.Net Web Service -> The project will get created Some Files as created: AssemblyInfo.cs/vb: sharing and reuse in the CLR, Web.config, service1.asmx, service1.asmx.cs/vb Create web service methods in the asmx.vb/cs files. A sample web-service method is already there Now you can …
Aug 20
Advanced XML Web Services Programming #24
Attributes of a web method. Using attributes, you can define the behavior of the methods exposed. Syntax VB.net _Public Function …. C# [WebMethod (BufferResponse=false)]public int HelloWorld(){…… Attributes: BufferResponse: Should the response be buffered? CacheDuration: Number of seconds the response is cached in memory Description: Describe a web method EnableSession: Should session state be enabled or …
Aug 19
Overview of XML programming in Dot Net #24
Overview of XML programming in Dot Net XML DOM(Document Object Model) Three ways to read XML documents in dot net are: XML DOM, SAX, XMLReader.DOM loads entire XML data into memory for processing, it is both read-write, I mean you can change XML data and save. DOM uses data-structures to represent the data in the …
Jul 31
.Net Package Managers #Blog #.Net/C#
What is NuGet? NuGet is the package manager for .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.