C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




code for searching in grid view


Posted Date: 13 May 2008    Resource Type: Code Snippets    Category: C# Syntax

Posted By: Sadhana Singh       Member Level: Gold
Rating:     Points: 10



The following code snippet shows how to implement searching in grid view

search.myclass ob1 = new search.myclass();

protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button2_Click(object sender, EventArgs e)
{
ob1.property_uid = TextBox1.Text;
ob1.property_pass = TextBox2.Text;
int x= ob1.insert();
if (x == 1)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "");

TextBox1.Text = "";
TextBox2.Text = "";
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "");
TextBox1.Text = " ";
TextBox2.Text = " ";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
bind();
}
void bind()
{
string flag1, flag2;
string val;
string s = TextBox3.Text;
if (TextBox3.Text == "*.*")
{
flag1 = "full";
flag2 = s;
}
else
{
int dotpos, len1, len2;
len1 = s.Length;
dotpos = s.LastIndexOf(".");
if (dotpos == -1)
{
flag1 = "atomic";
flag2 = s;
}

else
{
len2 = len1 - (2);
val = s.Substring(2,len2);
flag1 ="xyz";
flag2 = val;


}
}
ob1.property_flag = flag1;
ob1.property_uid = flag2;
DataSet ds = ob1.dset();
GridView1.DataSource = ds;
GridView1.DataBind();



}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to create a progressbar in asp.net
Previous Resource: code for downloading folders in grid view in asp.net
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween mask

Contact Us    Privacy Policy    Terms Of Use