this blog contains information for .net and sql stuffs. You can find various tips and tricks to overcome problem you may be facing in ...
Friday, March 25, 2011
Access to the path FileListAbsolute.txt is Denied (Error for TFS Project)
After going through project checked in files in server we come to know that during check in some one has checked in obj folder and that was causing this issue around the development area. After deleting this from source control and commit these changes, error of access denied was gone.
We also found same solution in after searching on internet.
Monday, March 21, 2011
Allow special character in XML
XML is very useful in any of the programming language. You have many controls of your data representation. One of the features of platform independent makes vital use of it.
In actual data we have different characters which are not supported in XML if we directly write in it. Here are some lists which can be used to replace actual character in XML.
Less than < can be replaced with <
Greater than > can be replaced with >
Ampersand & can be replaced with &
Quotation "can be replaced with "
Apostrophe ' can be replaced with &apos
At the end of replaced character we should keep one ;
Hope this list is useful when we want to use special character in XML.
Wednesday, March 2, 2011
Get next identity value in my table For SQL Server
It may require some time to know what will be our identity value before we actually insert record in our table. Usually we tend to find our max id value by selecting max id from records. But it may be possible you deleted records and now you want to know next identity value. SQL server has given a very nice function for it.
SELECT IDENT_CURRENT(‘mytable’)
In above line, mytable is table name, in which we want to find next identity value. Very impressive function!!
Thursday, February 3, 2011
Paging stored procedure for the SQL server 2000
Before a while ago, I have posted query for the true paging but it does not work in SQL server as ROWNUM is not available in it.
Here, is the sample stored procedure for SQL Server 2000
CREATE PROCEDURE [dbo].[State_Search]
@SearchText nvarchar(50) = null
,@PageNo int
,@PageSize int
,@TotalRecords int OUTPUT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @StartFrom int
SET @StartFrom = @PageSize * (@PageNo - 1);
CREATE TABLE #tmpState (
RowNo int IDENTITY(1,1) PRIMARY KEY,
RowId int NOT NULL
);
INSERT INTO #tmpState(RowId)
SELECT CHECKSUM([State].StateGuid) FROM [State]
WHERE (@SearchText IS NULL OR StateCode LIKE @SearchText OR
StateName LIKE @SearchText OR StateDesc LIKE @SearchText)
SET @TotalRecords = (SELECT COUNT(*) FROM #tmpState);
SELECT
[State].*
FROM #tmpState
INNER JOIN [State] ON CHECKSUM([State].StateGuid) = #tmpState.RowId
WHERE #tmpState.RowNo > @StartFrom AND #tmpState.RowNo <= (@StartFrom + @PageSize)
ORDER BY #tmpState.RowNo;
SELECT @TotalRecords AS TotalRecords;
DROP TABLE #tmpState;
END
Wednesday, January 5, 2011
OCR In .net with MS-Office 2007 component (MODI)
Once you have added that com reference you can work with images and can read text from it.
Tuesday, September 7, 2010
Difference between build and rebuild
In vs we find two options build and rebuild for our solution and very rarely we give attention what do we require.
There is very much difference between both of them, if you have noticed it, build takes less time compared to rebuild.
When we build application it complies files which has been changed it does not compile all files in project, while in case of rebuild it compiles all files weather it has been changed or not. Mainly rebuild should be done when so many files are changed and also it might possible some files are changed outside of IDE.
Hope this information will help to speed up your application when you choose rebuild instead of build.
Tuesday, August 10, 2010
Hide Tab Pages from Tab Control in Win forms
Recently I come to know one requirement to hide tab pages on my tab control of windows form depends on some condition.
I thought there could be some properties like Visible as we have in other controls. But surprisingly there is no such properties exist.
At the end I have only one solution to remove my tabpage from tab control. Let’s go through some code.
I have following tabControls.
myTabControl is my Tab Controls and I have following sub tabs(tab Pages) in it.
tabPage1
tabPage2
tabPage3
At index of 0, 1 and 2 respectively.
To hide my tabPage1 on my UI I have following options.
myTabControl.TabPaegs.Remove(0)
or
myTabControl.TabPages.Remove(tabPage1)
I hope this could be helpful when we have some condition for showing tabs.