Click here to Skip to main content
15,888,521 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Screen scraping Pin
Manas Bhardwaj26-May-09 1:33
professionalManas Bhardwaj26-May-09 1:33 
AnswerRe: Screen scraping Pin
Baran M26-May-09 1:50
Baran M26-May-09 1:50 
QuestionHow to create a sqlserver table from data table in c# Pin
Satish - Developer26-May-09 1:14
Satish - Developer26-May-09 1:14 
AnswerRe: How to create a sqlserver table from data table in c# Pin
Baran M26-May-09 1:33
Baran M26-May-09 1:33 
QuestionOpenId, face book connect login with RPX API Pin
gottimukkala26-May-09 0:36
gottimukkala26-May-09 0:36 
AnswerRe: OpenId, face book connect login with RPX API [modified] Pin
molson126-May-09 15:32
molson126-May-09 15:32 
QuestionGridview Pin
Rahad Rahman26-May-09 0:33
professionalRahad Rahman26-May-09 0:33 
AnswerRe: Gridview Pin
prateekfgiet26-May-09 0:37
prateekfgiet26-May-09 0:37 
use this code it will help u


private DataTable GetRecords()
{
conn.ConnectionString = "User ID=sa;Data Source=(local);Database=inventry";
//SqlConnection conn = new SqlConnection(strConnection);
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "Select ptype,pqty from total_stock";
SqlDataAdapter dAdapter = new SqlDataAdapter();
dAdapter.SelectCommand = cmd;
DataSet objDs = new DataSet();
dAdapter.Fill(objDs);
return objDs.Tables[0];
}
private void BindGrid()
{
DataTable dt = GetRecords();
if (dt.Rows.Count > 0)
{
grdSearch.DataSource = dt;
grdSearch.DataBind();
}
}
private void SearchText()
{
DataTable dt = GetRecords();
DataView dv = new DataView(dt);
string SearchExpression = null;
if (!String.IsNullOrEmpty(txtSearch.Text))
{
SearchExpression = string.Format("{0} '%{1}%'",
grdSearch.SortExpression, txtSearch.Text);
}
dv.RowFilter = "ptype like" + SearchExpression;
grdSearch.DataSource = dv;
grdSearch.DataBind();
}
public string Highlight(string InputTxt)
{
string Search_Str = txtSearch.Text.ToString();
// Setup the regular expression and add the Or operator.
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(),
RegexOptions.IgnoreCase);
// Highlight keywords by calling the
//delegate each time a keyword is found
return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
// Set the RegExp to null.
RegExp = null;
}
public string ReplaceKeyWords(Match m)
{
return "<span class=highlight>" + m.Value + "</span>";
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
SearchText();
}
AnswerRe: Gridview Pin
Ramesh Swaminathan26-May-09 0:45
Ramesh Swaminathan26-May-09 0:45 
AnswerRe: Gridview Pin
Baran M26-May-09 0:55
Baran M26-May-09 0:55 
QuestionI need your help Pin
Rahad Rahman26-May-09 0:28
professionalRahad Rahman26-May-09 0:28 
AnswerRe: I need your help Pin
Ramesh Swaminathan26-May-09 0:36
Ramesh Swaminathan26-May-09 0:36 
Questionconvert format DateTime in dd/MM/yyyy Pin
wertyk25-May-09 23:49
wertyk25-May-09 23:49 
Questionerror Must declare the variable '@pname'. Pin
prateekfgiet25-May-09 23:48
prateekfgiet25-May-09 23:48 
AnswerRe: error Must declare the variable '@pname'. Pin
adatapost26-May-09 1:09
adatapost26-May-09 1:09 
Questiongridview Pin
jainiraj25-May-09 22:44
jainiraj25-May-09 22:44 
AnswerRe: gridview Pin
Baran M25-May-09 22:51
Baran M25-May-09 22:51 
AnswerRe: gridview Pin
Tuwing.Sabado25-May-09 23:05
Tuwing.Sabado25-May-09 23:05 
AnswerRe: gridview Pin
ais0725-May-09 23:46
ais0725-May-09 23:46 
Questionediting problem in gridview Pin
prateekfgiet25-May-09 22:37
prateekfgiet25-May-09 22:37 
AnswerRe: editing problem in gridview Pin
Baran M25-May-09 23:43
Baran M25-May-09 23:43 
QuestionSecurity settings for single sign on web site Pin
samerh25-May-09 22:05
samerh25-May-09 22:05 
AnswerRe: Security settings for single sign on web site Pin
Manas Bhardwaj25-May-09 22:08
professionalManas Bhardwaj25-May-09 22:08 
GeneralRe: Security settings for single sign on web site Pin
samerh25-May-09 22:14
samerh25-May-09 22:14 
Questionibm language ware Pin
newmember2225-May-09 21:24
newmember2225-May-09 21:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.