SELECT * FROM OPENROWSET(
'Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Extended Properties=Excel 12.0;Database=D:\mssql\book1.xls;HDR=NO;IMEX=1',
'SELECT * FROM [Sheet1$]')
Wednesday, March 7, 2012
Tuesday, March 6, 2012
UPDATE Column(s) one table from a table in another database
Select Database Where update needs
Or Write USE Database
If Database selected then no need to write USE DB1
USE DB1 --(optional)
UPDATE DB1.dbo.MyTable
SET
Field1 = d2.Field1,
Field2 = d2.Field2,
Field3 = d2.Field3
FROM DB2.dbo.MyTable d2
WHERE d2.MyKey = MyTable.MyKey
Or Write USE Database
If Database selected then no need to write USE DB1
USE DB1 --(optional)
UPDATE DB1.dbo.MyTable
SET
Field1 = d2.Field1,
Field2 = d2.Field2,
Field3 = d2.Field3
FROM DB2.dbo.MyTable d2
WHERE d2.MyKey = MyTable.MyKey
Thursday, February 2, 2012
Configure File Upload size limit In Web Config
By default, the maximum size of a file to be uploaded to a server using the ASP.NET FileUpload control is 4MB(4096kb). You cannot upload filethat is larger than this limit.
In web config we can increase the size limit using following settings.
Note:-
Max value of maxRequestLength is "1048576" (1 GB) for .NET Framework 1.0/1.1 and "2097151" (2 GB) for .NET Framework 2.0.
ExecutionTimeout allows maximum number of seconds that a request is allowed to execute before being automatically shut down by the application. The executionTimeout value should always be longer than the amount of time that the upload process can take.
In web config we can increase the size limit using following settings.
Note:-
- The size specified is in kilobytes.
- This limit can be used to prevent denial of service attacks (DOS) caused by users posting large files to the server
Max value of maxRequestLength is "1048576" (1 GB) for .NET Framework 1.0/1.1 and "2097151" (2 GB) for .NET Framework 2.0.
ExecutionTimeout allows maximum number of seconds that a request is allowed to execute before being automatically shut down by the application. The executionTimeout value should always be longer than the amount of time that the upload process can take.
Friday, April 30, 2010
TextBox.MultiLine maxlength
function checkTextAreaMaxLength(textBox,e, length)
{
var mLen = textBox["MaxLength"];
if(null==mLen)
mLen=length;
var maxLength = parseInt(mLen);
if(!checkSpecialKeys(e))
{
if(textBox.value.length > maxLength-1)
{
if(window.event)//IE
e.returnValue = false;
else//Firefox
e.preventDefault();
}
}
}
function checkSpecialKeys(e)
{
if(e.keyCode !=8 && e.keyCode!=46 && e.keyCode!=37 && e.keyCode!=38 && e.keyCode!=39 && e.keyCode!=40)
return false;
else
return true;
}asp:TextBox Rows="5" Columns="80" ID="txtCommentsForSearch" MaxLength='1999' onkeyDown="checkTextAreaMaxLength(this,event,'1999');" TextMode="multiLine" runat="server">
Subscribe to:
Posts (Atom)
