About Us
Quadtechindia is your ultimate guide to free and open source code for ASP.NET,C#,php,SQL Server, active server pages (ASP), javscript,database,PHP,source code for Software developers arround the world. It has an open forum for programmers to view codes post by other programmers and can also post their codes for their and others use as knowledge is the only wealth that increases on sharing it with others.

News
Comming Soon!
Recent Posts of Forum
Get Week day in VB.NET
Dim intDOW as int16
intDOW = Weekday(Now)
Weekday:Returns a number from 1 to 7 indicating the day of the week for a given date, where 1 is Sunday and 7 is Saturday.
Constant Value
vbSunday 1
vbMonday 2
vbTuesday 3
vbWednesday 4
vbThursday 5
vbFriday 6
vbSaturday 7
Happy Coding.
;) ;) ;) ;) ;) ;) ;) ;) ;)
===================================================================
Get date in DD MMM YYYY format in VB.NET
Response.Write(Now.ToString("dd MMMM yyyy"))
Happy Coding
;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;)
===================================================================
Code to set title for webpart
this.WebPartZone3.WebParts[0].Title = "String you want";
write this code in page load event.
===================================================================
VB.Net code to download data in txt format.
Dim ds As DataSet = New DataSet
Dim i As Integer
Dim strContents As String = ""
ds = classname.function(parameter1,parameter2)
If ds.Tables(0).Rows.Count > 0 Then
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=OnlineSoftReport.txt")
Response.ContentType = "application/octet-stream"
Response.Charset = ""
Me.EnableViewState = False
strContents = "Header1|Header2|" + Environment.NewLine.ToString()
For i = 0 To ds.Tables(0).Rows.Count - 1
strContents = strContents + Convert.ToString(ds.Tables(0).Rows(i)(0)) + "|" + Convert.ToString(ds.Tables(0).Rows(i)(1)) + Environment.NewLine.ToString()
Next
Response.Write(strContents)
Response.End()
End If
Happy Coding :)
===================================================================
VB.Net code to check special characters.
Use below function:
Public Function test(ByVal des As String)
Dim illegalChars As Char() = "!@#$%^&*(){}[]""_+<>?/".ToCharArray()
Dim str As String = des
For Each ch As Char In str
If Not Array.IndexOf(illegalChars, ch) = -1 Then
Response.Write("Error")
End If
Next
End Function
Call above function on button click:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
test(TextBox1.Text)
End Sub
Happy Coding :)
===================================================================
AJAX Drawbacks/Disadvantage
AJAX technology is very help full but as we know every coin has two aspect . Like other AJAX technology also have some drawbacks/disadvantage some are list below. So before developing your application with AJAX you should know about advantage and disadvantage of AJAX.
1. The page address doesn’t change while working , so you can’t bookmark
AJAX-enabled pages.
2. Search engines may not be able to index all protions of your AJAx
application site.
3. The Back button in browsers , doesn’t produce the same result as with
classic web applications, because all actions happen inside the same page.
4. Javascript can be disabled at the client side, which makes the AJAX
application non-functional, so it’s good to have another plan in your
site, whenever possible, to avoid losing visitors.
===================================================================
LINQ vs Stored Procedures
Some advantages of LINQ over Stored Procedures:
1. Abstraction: This is especially true with LINQ-to-Entities. This abstraction also allows the framework to add additional improvements that you can easily take advantage of. PLINQ is an example of adding multi-threading support to LINQ. Code changes are minimal to add this support. It would be MUCH harder to do this data access code that simply calls sprocs.
2. Debugging support: I can use any .NET debugger to debug the queries. With sprocs, you cannot easily debug the SQL and that experience is largely tied to your database vendor (MS SQL Server provides a query analyzer, but often that isn't enough).
3. Vendor agnostic: LINQ works with lots of databases and the number of supported databases will only increase. Sprocs are not always portable between databases, either because of varying syntax or feature support (if the database supports sprocs at all).
4. Deployment: Others have mentioned this already, but it's easier to deploy a single assembly than to deploy a set of sprocs. This also ties in with #4.
5. Easier: You don't have to learn T-SQL to do data access, nor do you have to learn the data access API (e.g. ADO.NET) necessary for calling the sprocs. This is related to #3 and #4.
Some disadvantages of LINQ vs Stored Procedures:
1. Network traffic: sprocs need only serialize sproc-name and argument data over the wire while LINQ sends the entire query. This can get really bad if the queries are very complex. However, LINQ's abstraction allows Microsoft to improve this over time.
2. Less flexible: Sprocs can take full advantage of a database's featureset. LINQ tends to be more generic in it's support. This is common in any kind of language abstraction (e.g. C# vs assembler).
3. Recompiling: If you need to make changes to the way you do data access, you need to recompile, version, and redeploy your assembly. Sprocs can sometimes allow a DBA to tune the data access routine without a need to redeploy anything.
Security and manageability are something that people argue about too.
1. Security: For example, you can protect your sensitive data by restricting access to the tables directly, and put ACLs on the sprocs. With LINQ, however, you can still restrict direct access to tables and instead put ACLs on updatable table views to achieve a similar end (assuming your database supports updatable views).
2. Manageability: Using views also gives you the advantage of shielding your application non-breaking from schema changes (like table normalization). You can update the view without requiring your data access code to change
What I Concluded :-
Write a Stored Procedure but access it using LINQ.
===================================================================
Get day name from date in SQl
Syntax:DATENAME (datepart ,date )
Example: select datename(dw,getdate())
[b]datepart-->Abbreviations[/b]
year-->yy, yyyy
quarter-->qq, q
month-->mm, m
dayofyear-->dy, y
day-->dd, d
week-->wk, ww
weekday-->dw
hour-->hh
minute-->mi, n
second-->ss, s
millisecond-->ms
microsecond-->mcs
nanosecond-->ns
TZoffset-->tz
;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;)
===================================================================
Differance Between VB.NET and C#
Advantages VB.NET :-
√ Has support for optional parameters which makes COM interoperability much easy.
√ With Option Strict off late binding is supported.Legacy VB functionalities can be
used by using Microsoft.VisualBasic namespace.
√ Has the WITH construct which is not in C#.
√ The VB.NET part of Visual Studio .NET compiles your code in the background.
While this is considered an advantage for small projects, people creating very large
projects have found that the IDE slows down considerably as the project gets larger.
Advantages of C#
√ XML documentation is generated from source code but this is now been incorporated
in Whidbey.
√ Operator overloading which is not in current VB.NET but is been introduced in
Whidbey.
√ Use of this statement makes unmanaged resource disposal simple.
√ Access to Unsafe code. This allows pointer arithmetic etc, and can improve
performance in some situations. However, it is not to be used lightly, as a lot of the
normal safety of C# is lost (as the name implies).This is the major difference that you
can access unmanaged code in C# and not in VB.NET.
===================================================================
Boxing and Un-Boxing Example
Boxing is a process in which object instances are created and copy
values in to that instance.
Unboxing is vice versa of boxing operation where the value is copied from the instance in to
appropriate storage location.
Example:
Dim x As Integer
Dim y As Object
x = 10
‘ boxing process
y = x
‘ unboxing process
x = y
===================================================================

