|
priyamsc wrote: how to count the value. that is, all the data which displays in gridview
Try out ds.Tables[0].Rows.Count..(just check the syntax )
|
|
|
|
|
could you say little bit clearly
k.priya
|
|
|
|
|
I think, you can get the count of rows which you are looking for.
ds.Tables[0].Rows.Count would give you the count of rows.
Let me know if you are looking for something else.
|
|
|
|
|
can i get rowindex of paricular row in a table
|
|
|
|
|
amarnath n.n wrote: can i get rowindex of paricular row in a table
which kind of table ? Are you talking about GridView or what ?
|
|
|
|
|
|
sorry wrongly sent
Table in a DataSet
|
|
|
|
|
amarnath n.n wrote: Table in a DataSet
Yes you can. Load the DataSet Table data in DataTable . Then you can read the data from each and every row based on row index.
DataSet Ds= LoadDataSet();
if (Ds.Tables["Table1"].Rows.Count>0)
{
DataTable dtable = new DataTable();
dtable = Ds.Tables["Table1"];
string Name= dt1.Rows[0]["Name"].ToString();
}
This is an sample example, Hope this will help you
|
|
|
|
|
Not like this i want to get the rowindex of particular row.see the code which i am trying to do that
DataRow[] row =dsphotos.Tables[0].Select("PHOTO_ID",Session["ID"].ToString());
int rowindex= dsphotos.Tables[0].Rows.IndexOf(row[0]);
|
|
|
|
|
So what's your question? You are fine with your implementation or you want something else.
|
|
|
|
|
How to pass an array from asp.net aspx.cs page go javascript function
|
|
|
|
|
amarnath n.n wrote: How to pass an array from asp.net aspx.cs page go javascript function
Check your last post, many members are answered on the same.
Your last post [^]
|
|
|
|
|
Hello Is there a way to retrieve text from datalist
thanks alot
|
|
|
|
|
|
Thanks for the answer but I mean the text inserted without any control..
Thanks.
|
|
|
|
|
You can't insert text without a control. What DataList are you talking about?
only two letters away from being an asset
|
|
|
|
|
Dear All,
I have a page holding data in data list. I created paging option for datalist with dynamic link buttons created during-page pre init event. It runs if(!Ispostback).
Then I hold number of pages in session in order not to connect to database in each page refresh.
Then I have dropdown list accorging to which the number of pages changes. So the number of link buttons also should change with selection.
However when I clicked on the button page-preinit creates the link buttons before the it handles click event, therefore creates the link buttons according to the number hold in session, in other words according to previous page number..
Here are the codes
protected void page_Preinit(object sender, EventArgs e)
{
if (!IsPostBack)
{
getpagecount("0","0","0"); // gets the page count form database.
}
else { lb_Count = int.Parse(Session["Page"].ToString()); } //gets the figure in the session.
for (int i = 1; i <= lb_Count; i++)
{
LinkButton bottomLink = new LinkButton();
LiteralControl bottomLiteral = new LiteralControl(" ");
bottomLink.Text = i.ToString();
pnlBottom.Controls.Add(bottomLink);
pnlBottom.Controls.Add(bottomLiteral);
bottomLink.Click += new EventHandler(this.changeLink);
}
if (con!=null && con.State == ConnectionState.Open)
{
con.Close();
cmd.Dispose();
}
}
HERE IS THE CLICKED EVENT
protected void btnYemekler_Click(object sender, ImageClickEventArgs e)
{
//HERE, THE PAGE NUMBER IN SESSION CHANGES BUT THE LINK BUTTOS ARE ALREADY CREATED.
getpagecount(DlAscilar.SelectedValue.ToString(),
DlMutfaklar.SelectedValue.ToString(), DlBolgeler.SelectedValue.ToString());
doldur(DlAscilar.SelectedValue.ToString(),
DlMutfaklar.SelectedValue.ToString(), DlBolgeler.SelectedValue.ToString());
dlListe_Doldur(0);
}
WHAT CAN I DO TO HANDLE THIS PROBLEM.
THANKS IN ADVANCE
|
|
|
|
|
My answer may/may not be dirty, but that would work.
1. Place a Server-Side HiddenField in the *.aspx file.
2. Handle the OnClientClick event (JavaScript) of the Button.
3. OnClientClick you have to set the page number or whatever data you want into the HiddenField.
4. After the OnClientClick event, Button's Click process will start.
5. Now in your Page_PreInit get the values of the HiddenField and continue your routine process.
6. Here you can get rid of Session object.
Let me know if you have questions. Please mark it as answer if it helps you.
|
|
|
|
|
I marked it Thanks alot.
|
|
|
|
|
Hello,
When I add a TemplateField to GridView it is alwasy my first field by default.
How can I change the order?
|
|
|
|
|
|
I have used the following code for reading word document. But it reads only text data and not displaying the images in the word document.
string docname = dr["docname"].ToString();
string path= Server.MapPath("festival_doc");
string m = path + "//"+docname;
Word.ApplicationClass wordapp = new Word.ApplicationClass();
object file = m;
object nullobj = System.Reflection.Missing.Value;
Word.Document doc1 = wordapp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
TextBox1.Text = doc1.Content.Text;
doc1.Close(ref nullobj, ref nullobj, ref nullobj);
regards, Rajesh
|
|
|
|
|
Your last message is just a message below this on the same page and still you reposted it.
This is very RUDE.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Rather than posting a new thread, you should replyed it on my question.
|
|
|
|
|
I have used the following code for reading word document. But it reads only text data and not displaying the images in the word document.
string docname = dr["docname"].ToString();
string path= Server.MapPath("festival_doc");
string m = path + "//"+docname;
Word.ApplicationClass wordapp = new Word.ApplicationClass();
object file = m;
object nullobj = System.Reflection.Missing.Value;
Word.Document doc1 = wordapp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
TextBox1.Text = doc1.Content.Text;
doc1.Close(ref nullobj, ref nullobj, ref nullobj);
regards, Rajesh
|
|
|
|