Thursday, April 21, 2011

Proxy Servers

Internet resources you are accessing. They allow you to bypass firewalls and content filters and browse your favorite websites, without revealing your location (IP address).
Here is a free proxy list and proxy checker providing you with the best free proxies for over 8 years. Our sophisticated checking system measures many parameters of free proxy servers and combine them to compute our unique proxy rating. One index to rule them all :-) that includes dozens of various characteristics and how do they change in time. Only the best proxies receive the maximum rating 100. View our Proxy List Sorted By Rating!

15 Random With Highest Rating

trycatchme.com - United States
autoinsure.info - United States
freeurip.com - United States
sacredtunnel.info - United States
quickprox.info - Great Britain (UK)
go-fish.info - Singapore
freesafesurf.info - United States
connectionproxy.com - United States
stupidteacher.info - United States
runningnet.info - United States
blasttunnel.info - United States
tunnelworst.info - United States
wholebypass.info - United States
netwideopen.com - United States
tunnelaccess.info - United States

15 Newly Added Proxy Servers
bryanbrosfoundation.org - United States
allocationloansurf.info - United States
amortizedloansurf.info - United States
hide25.com - United States
proxyformyspace.info - United States
tunnelworst.info - United States
wholetunnel.info - United States
runningnet.info - United States
advertisementanonymous.info - United States
calculateforexsurf.info - United States
theanonymoussurf.info - United States
balancedfundloansurf.info - United States
approveforexsurf.info - United States
freedombyproxy.com - United States
tunnelaccess.info - United States
15 Proxies With Best Access Time
trycatchme.com - United States
autoinsure.info - United States
freesafesurf.info - United States
sacredtunnel.info - United States
greasyproxy.info - United States
dearproxy.info - United States
harshproxy.info - United States
wholebypass.info - United States
netwideopen.com - United States
unblockthe.info - United States
sandbypass.info - United States
secureproxi.info - United States
stupidteacher.info - United States
hidefrom.com - United States
freeurip.com - United States

15 Non-US Proxy Servers

tradeadspace.info - Canada
tissi.net.br - Brazil
proxysimple.info - France
quickprox.info - Great Britain (UK)
reldy.com - Germany
go-fish.info - Singapore
thebestwebsearch.com - Canada
jand0wn.info - Canada
totalsecure.info - Great Britain (UK)
cinipac.net - Estonia

Wednesday, April 20, 2011

Query to find all the tables and columns in selected database

As a developer, it is really important for us to understand database design and underlying tables used in application. Sometime we do not have direct access to database server so that we can not open the server console and look in to the database.

In this case we can take help of SysObjects, SysColumns, SysTypes tables of SQL Server 2005. These tables stores the information about each tables and columns and their data types. Using this tables you can write the query to find out all the tables and columns in selected database. Below is the query that gives you all the table and columns for those tables with data types and length.

SELECT

SysObjects.[Name] as TableName,
SysColumns.[Name] as ColumnName,
SysTypes.[Name] As DataType,
SysColumns.[Length] As Length

FROM
SysObjects INNER JOIN SysColumns
ON SysObjects.[Id] = SysColumns.[Id]

INNER JOIN SysTypes
ON SysTypes.[xtype] = SysColumns.[xtype]

WHERE
SysObjects.[Type]='U'
ORDER BY
SysObjects.[Name]

“Type” columns of SysObjects table represent the different objects available in database (like Table,Trigger,Stored Procedures etc.). Below list explains the different values of “Type” columns.

C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
FN = Scalar function
IF = Inlined table-function
K = PRIMARY KEY or UNIQUE constraint
L = Log
P = Stored procedure
R = Rule
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
V = View
X = Extended stored procedure

For more detail refer SysObjects and SysColumns. and So in fig – (1) query uses [type] = ‘U’. This means query displays al the user tables. You can change the condition in WHERE clause to get different objects. The query shown below displays all the triggers in selected database.

SELECT
b.[Name] as [Table Name],
a.[Name] as [Trigger Name],
a.[crdate] as [Created Date]
FROM
SysObjects a INNER JOIN Sysobjects b
ON a.[parent_obj] = b.[id]
WHERE
a.[type] = 'TR'
ORDER BY
b.[Name]

Happy Programming !!!!

Wednesday, April 6, 2011

Import Excel Spreadsheet Data into SQL Server Database Table Using SqlBulkCopy

In Web Config:
AppSettings :

add key="Excel2003SqlConnection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties="Excel 8.0;HDR=YES;IMEX=1"">
add key="Excel2007SqlDBConnection" value="Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=1"">
add key="FileUploadLocation" value="~/ExcelFilesUploaded/Temp"/>



Funtction to Upload Excel Files:

public void UploadExcelFileToDataBase(string DestServer, string DestDatabase, string DestUserID, string DestPassword, string destinationtableName, string ExcelSheetRange,FileUpload fileUpload1,Label label1)
{
try
{

if (fileUpload1.HasFile)
{
//the location is given in the web.config file's Appsettings.
string SaveLocation = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["FileUploadLocation"]);
string location = SaveLocation + fileUpload1.FileName;
fileUpload1.SaveAs(location);

string xConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source= " + location + ";" + "Extended Properties=Excel 8.0;";
using (OleDbConnection connection = new OleDbConnection(xConnStr))
{

OleDbCommand command = new OleDbCommand("Select * FROM " + ExcelSheetRange + "", connection);

connection.Open();

//delete all previous records from the table.

SQLHelper objSql = new SQLHelper();
objSql.SqlText = "Delete from " + destinationtableName;
objSql.ExecuteSql(false);
objSql.Close();
objSql.Dispose();

// Create DbDataReader to Data Worksheet
using (DbDataReader dr = command.ExecuteReader())
{
// SQL Server Connection String
string ConnString = "server = " + DestServer + "; database = " + DestDatabase + "; user id= " + DestUserID + ";password=" + DestPassword;
string sqlConnectionString = ConnString;
// Bulk Copy to SQL Server
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = destinationtableName;

bulkCopy.WriteToServer(dr);

}
}
}
label1.Visible = true;
label1.Text = "Data Uploaded Successfully on " + destinationtableName;
}
}
catch (Exception ex)
{
label1.Text = ex.ToString();
}
}