Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How to Hide Select Query Strings using ASP.Net and VB.Net

Author: DevASP
Download Source Code : 414_Select Code And DLL.zip

In this Article I will show that how we can Hide our Select Query. Source Code is Given with that Article.

Query Strings our some times Shows Your Whole Logic (What You Are Trying to do with Database) in Asp.net. Is Asp.net project is running on internet then its Ok because now We have SSL (Security Socket Layer) But When We Run it on LAN (Local Area Networks) in Any Organization then it is possible That your Query Strings can Helps to Understand Your Logic.

 

For the better Understanding Follow These Steps.

 

1-Open new Project and Select Class Library from New Project Modules Showing on Right Side of window.

 

2-Now in code window write line of codeWhich define Querry.

 

Public Select_Querry As String = "Select * From Table"

 

That Is the string which holds my query string.

 

3-Now make the connection function given below:

Public Function Connect(ByVal ConnectionStr)

        Cn.ConnectionString = ConnectionStr

        Try

            Cn.Open()

            myCm.Connection = Cn

            msgConnect = "Connection Established Successfully "

        Catch ex As Exception

            msgConnect = ex.Message & "Connection Error "

        End Try

        CheckFlag = "False"

    End Function

4-Then make reader Function in which we Active the query string.

 

Public Function Reader(ByVal Query)

        myCm.CommandText = Query

        myCm.CommandType = CommandType.Text

        Try

            myRd = myCm.ExecuteReader

            msgReader = "Reader Executed Successfully "

        Catch ex As Exception

            msgReader = ex.Message & "Reader Error "

        End Try

    End Function

 

5- Build the project.

6- Now close the code window and go to the location where your project is stored in bin folder you find the dll.

 

7- New Project Web Application in ASP.Net using VB.Net.

 

8-Now On right side you will find the solution explorer where You find the Resources. By  right click on resources you will find the add resources.

 

9-add Your Dll Here.

 

Now use That Class As Built-in ASP.Net Namespaces.

 

Source Code is given with this Article.

Article Comments
Very helpful

Posted on 8/20/2006 1:44:46 AM by Phil

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How to Swap Mouse Buttons using Win32 API in VB.Net (Part 5)

Disclaimer - Privacy
© 2002-2017 DevASP.net