• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

About me

Let me introduce myself


A bit about me

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Profile

Deepak Bhagya

Personal info

Deepak Bhagya

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.

Birthday: 21 SEP 1986
Phone number: +(12) 34 567 89
Website: www.dakshbhagya.com
E-mail: Me@dakshbhagya.com

RESUME

Know more about my past


Employment

  • 2015-future

    Mutation Media @ Web Developer

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2011-2014

    Websoham @ Exclusive Admin

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2009-2011

    Templateclue.com @ Lead Developer

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Education

  • 2015

    University of Engineering @Level

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2013-2014

    College of Awesomeness @ passed

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • 2009-2013

    College of Informatics @ graduated

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Skills & Things about me

photographer
86%
html & css
Punctual
91%
illustrator
Web Developer
64%
wordpress

Portfolio

My latest projects


Showing posts with label Technique. Show all posts
Showing posts with label Technique. Show all posts

Wednesday, March 14, 2007

Useful Techniques in Asp.Net

1. Finding the particular Data from the Dataset,Its Row Position and Current Page in Grid
====================================================================================
DataSet dsQuoteList = objQuote.GetQuoteBankList();

Giving a constraints to the first column that is the ID primary key like:

dsQuoteList.Tables[0].Constraints.Add("pk", dsQuoteList.Tables[0].Columns[0], true);

Now,

The below code will find the perticular ID int the given dataset and return new Datarow..

DataRow dr = dsQuoteList.Tables[0].Rows.Find("10540");

Now finding the Row position (RowIndex) in the Dataset, like..:

int RowIndx = int.Parse(dsQuoteList.Tables[0].Rows.IndexOf(dr).ToString()

Finally, You will get the exact position of particular Data in the Dataset.

In Addition You can also find the Current Page in the Datagrid or GridView after getting Datarow:

int PageSize = 10;

double CurrPage = Math.Ceiling(Convert.ToDouble(int.Parse(dsQuoteList.Tables[0].Rows.IndexOf(dr).ToString()) /
PageSize ));

Done..

That's it !

2. Find the Exact words from string
==================================

using System.Text;
using System.Text.RegularExpressions;

Write in the Button Click Event :

private void button1_click(object sender, EventArgs e)
{
string strInput = "Hello World I am Here with the new sunrise";
string strOutput = FindFirstWords(strInput, 4);

// Here the result of strOutput variable is :
Hello World I am
}

Function to get the Words from string:

private string FindFirstWords(string input, int HowManyFind)
{
string REGEX = @"([\w]+\s+){" + HowManyFind + "}";

StringBuilder output = new StringBuilder();

foreach (Capture capture in Regex.Match(input, REGEX).Captures)
{
output.Append(capture.Value);
}
return output.ToString();
}

3. foreach loop in Enum
==================================

objDataImport = new DataImport();
foreach (string s in Enum.GetNames(typeof(DataImport.eTotalFeature)))
{
objDataImport.CurrentFeature = (DataImport.eTotalFeature)Enum.Parse(typeof(DataImport.eTotalFeature), s);
objDataImport.FetchContent();
}

4. Read line by line from text file in C#
==========================================


string strFile = @"C:\Files\new.txt";

StreamReader objStreamReader = File.OpenText(strFile);

string strGetLine;
while ((strGetLine = objStreamReader.ReadLine()) != null)
{
Response.Write(strGetLine);
}

How to download any file with Asp.Net
=================================

string FileName = Server.MapPath("style.css").ToString();

Response.Clear();
Response.ClearContent();
Response.ContentType = "text/plain";
Response.AddHeader("Content-Disposition", "attachment; filename=Name.css;");

byte[] buffer = System.IO.File.ReadAllBytes(FileName);

System.IO.MemoryStream mem = new System.IO.MemoryStream();
mem.Write(buffer, 0, buffer.Length);

mem.WriteTo(Response.OutputStream);
Response.End();


Render GridView to Html String
==========================

In many times I have faced a problem when you want to
render html string for GridView Control, but you
probably find error like...

"Control '<GridViewID>' of type 'GridView' must be placed inside a form tag with runat=server."

In this case you have to use one method to avoid this error..

public override void VerifyRenderingInServerForm(Control control)
{
// Confirms that an HtmlForm control is rendered for the
// specified ASP.NET server control at run time.

// No code required here.
}

and in the page directives just add this code marked in Bold Text..

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CompanyList.aspx.cs" Inherits="CompanyList" EnableEventValidation="false" %>

That's it !
Hope you will like it.



Services

What can I do


Branding

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Web Design

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque.

Graphic Design

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Development

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Photography

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

User Experience

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com