Archive for 2012

Client side validation of File type before you upload a file



To validate a file type or say file extension on client side before you upload a file can be performed by just putting a Regular Expression Validator. Here, i have provided one example to allow uploading only .jpg or .gif files. All you need is a FileUpload control and a Regular Expression Validator to check file type.

<asp:FileUpload ID=”FileUpload1″ runat=”server” />

<asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ runat=”server” ControlToValidate=”FileUpload1″ Display=”Dynamic” ErrorMessage=”Upload a valid file” ValidationExpression=”^.+(.jpg|.JPG|.gif|.GIF)$”></asp:RegularExpressionValidator>

If you want to put your own file type validation then just replace “.jpg,.JPG,.gif,.GIF” text, and you can add more file types by adding “|” (pipe) sign and your own file type to validate.

Tuesday, December 11, 2012
Posted by ஆனந்த் சதாசிவம்
Tag :

ConnectionStrings in ASP.NET


<connectionStrings>
<add name="con" connectionString="Data Source=SERVER NAME;Initial Catalog=datamining;Persist Security Info=True;User ID=sa;Password=root"/>

</connectionStrings>



<appSettings>
<add key="connection" value="server=SERVER NAME;user id=sa;password=root;initial catalog=Hindustan;pooling=false"/>

</appSettings>
Thursday, November 22, 2012
Posted by ஆனந்த் சதாசிவம்
Tag :

Import CSV File into MYSQL Query Browser

Import CSV File into MYSQL Query Browser :



Simple Query: 

LOAD DATA LOCAL INFILE 'E:/123.csv' INTO TABLE documentupload FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';





After that i used “select * from test_table”. The data are displayed 
Monday, November 19, 2012
Posted by ஆனந்த் சதாசிவம்
Tag :

test

test
Thursday, November 1, 2012
Posted by ஆனந்த் சதாசிவம்

Popular Post

Blogger templates

Labels

Search Box

Follow us on Facebook

- Copyright © .net -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -