Wednesday, November 20, 2013

Basic difference between .net 3.5 and 4.0

In this article I will explain difference between .net 3.5 and 4.0.


Difference between Framework 3.5 and Framework 4.0:

  1. EnableViewState - [true or false] in Framework 3.5
    EnableViewState -[Enabled/Disabled/Inherits] in Framework 4.0.


    2.Keyword and Description is added in Framework 4.0 while it is not available in Framework 3.5 in the Page Directives.

    3.use Multi-Targeting Feature:
    For using multi-targeting feature , users will have to add “targetframework” attribute in the compilation element of the web.config file. 


    Dear all i knew only this difference if some one know more pls welcome to add here   

Monday, November 18, 2013

String or binary data would be truncated. The statement has been terminated in .net

Introduction:

how to solve the problem of “string or binary data would be truncated. The statement has been terminated". When data Insert in sql server.

 Description:


  In one project I am trying to insert data into one table using SQL queries at that time I got error like “String or binary data would be truncated. The statement has been terminated.” Actually this problem because of I declared column datatype varchar(200) but I am inserting data more than 200+ characters in that column. To solve this problem I modified column datatype varcha (200) to varchar(MAX)

I will explain with one example I have query like this
DECLARE @Details TABLE(UserId INT, Note VARCHAR(MAX))
INSERT INTO @UserDetails(UserId,UserName)
VALUES(1,'Arjun Walmiki','')
SELECT * FROM @Details
If you observe above query I declared Note field with VARCHAR(200) and inserting more than 200 characters because of that I got error like 


 



Note:- Welcome to add your comment and suggestion. 

Wednesday, November 6, 2013

Remove the commas remove the bracket in Java

In this program you will learn Remove the commas and bracket We are going to use replaceAll() or replace() method of String class in Java. The description of the code is given below for the usage of the method.

Description of the code:-

Here, you will get to know about the replaceAll() or replace() method through the following java program. In the program code given below, we have taken a String Or list.

String name=String.valueOf(loginCountBean1.getM_strEmployeeName());
hssfCell1.setCellValue(name);
// you can use below line of code for replace the commas.
 
hssfCell1.setCellValue(name.replaceAll("\'", "")); 

 Using List :-

String data = String.valueOf(cells.next());

HSSFCell hssfCell = hssfHeader.createCell(x);

hssfCell.setCellValue(data);

 // you can use below line of code for replace the bracket  from List.

hssfCell.setCellValue(data.replace("[", "").replaceAll("]", "")); 



Note :- I am use here Excel sheet to display the result from Mysql server.


Thank you to read and welcome to add your suggestion .