|
Hi
Thanks for your kind response , but you didn't get mt question.
i add one button in ItemdatBound event of datagrid.i give a command name to that button but itemcommand event not fired .
eg. dim btn as new button
e.item.cell(0).control.add(btn)
btn.commandname="edit"
how to create runtime button in itemcreate event of datagrid ?
and is it possible to fire itemcommand event when i clicked tht added button ?If is it possible give us example.
Thanks in advance ,
Monika
|
|
|
|
|
|
Hi there...
I want to count the total records which retrieving from database. By using DataReader, how can i count the records and i store that in a textbox..
Regards n Thanks
Sam.M
|
|
|
|
|
Datareader fetches one row at a time as so you need to loop thru while end of Datareader (read) and increment an explicit counter variable to count the records.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Hi ....
Very thks... but i want to get the total number of records using datareader
Thks n Advance
Sam.M
|
|
|
|
|
As far as i am concerned....this is not possible.......you need to loop thru with DataReader to get the count.......OR use datasets
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Try this code
dim i as integer=0
do while dr.read()
i=i+1
loop
Label1.Text="No of Records : " & i.toString()
Hope this may help u
Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
The datareader is a secuencial reader.
so you must to loop all the datareader to know how many files you got.
<br />
sqldatareader dr = sqlcommand.executereader();<br />
<br />
int num_lines = 0;<br />
while dr.read()<br />
{<br />
i++;<br />
}<br />
<br />
Message.Text = i.toString();<br />
Have Fun
keep Learning and you never will be out of date...
|
|
|
|
|
Sam.M wrote: I want to count the total records which retrieving from database. By using DataReader, how can i count the records and i store that in a textbox..
You can't directly. DataReader classes read through a file sequential, so you'd have to read all records and increment your own counter.
Depending on how many records, you could load the data into a DataSet/DataTable and use the Rows.Count to find out how many rows.
Alternatively, run a SELECT Count(*) on your table and return that result via a DataReader.
|
|
|
|
|
|
foreach(DataGridItem dataGridItem in DataGrid1.Items)
{
string r=(dataGridItem.Cells[2].Text);
Int32 sum=int.Parse(r);
Response.Write(sum);
}
iam using the above code and iam trying to convert an
string to int iam getting exception
Input string was not in a correct format. at System.Number.ParseInt32(String s,NumberStyles style, NumberFormatInfo info)
plz let me know asap
with regards
ravi
|
|
|
|
|
What string are you getting in variable 'r' ?
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
|
What is the value you are getting in r(string)? It may not be a integer thats why you are getting the exception.
Best Regards,
Apurva Kaushal
|
|
|
|
|
This code may help u
// C# code
String sNumber = "123";
int iNumber = Convert.ToInt32(sNumber);
' VB.NET code
Dim sNumber as String = "123"
Dim iNumber as Integer = Convert.ToInt32(sNumber)
Thanks and regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
How can i stop back button(disable) when my home page is loaded or when user logout. so how can i trace back button.
provide code to trap back button.
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
i can give you a idea.
when a user is logoff you application that time you have to call a another form (like "logout.aspx" )for stoping in to user go back.
now you can write a javascript on Body tag window.open(index.aspx");
wirte in Header Tag
<code><javascript>
function logout()
{
window.open(index.aspx");
}
</javascript></code>
call this function on body load.
<big><b><body onload="logout()"></b></big>
i thing this is very help full for you.!
Cheer
Pavan Pareta
|
|
|
|
|
Hi All
I need to generate multiple line charts dynamically using ADO.NET data in ASP.NET 1.1 application.
If anyone can provide me a link to some example code to handle line charts. By "line
graphs" means,graphs that have dates on the X-axis and data on the Y-axis in several colored lines .
I'm limited of not using any readily available graph tools/controls.
The Graph with features i'm looking to generate will look in the manner as available in this link below:
(http://finance.yahoo.com/charts) or (http://finance.google.com/finance?q=CSCO)
Thanks in advance
Regards-
bskvarma
|
|
|
|
|
Hi,
I want to develop multi language application windows application using asp.net with c#.
please help me. I am new learner.
Thanks,
libra
|
|
|
|
|
you can use resourse file for every form in C# but you have to define a file of each language. "Resource1.resx"
this file has a information of a form, and every form controls information also saved in this file.
when a form is add this file also created autometically. u can also Add new Resource File for another one language.
Like you have using 3 language is supported by your application. you have to create (3 Resource File for --> a single FORM)
try
Pavan Pareta
|
|
|
|
|
|
hi,
i am trying to make a login page in asp.net 2.0.
i have selected login
i have a database named as user.
i would like to know when i enter the username and password from my login page it should only allow me to enter as per the data's in my database.
and i am unable to connect the login page to my oracle database.
plz help me.
regards,
ratish.
|
|
|
|
|
Is your connection string correct?
|
|
|
|
|
tht's wht i am not understanding if u want i can send u the source code .
|
|
|
|
|
I have a question regarding keeping a username in the cache in order to
prevent multiple logins. I read 'Preventing Multiple Logins in ASP.NET' by
Peter Bormberg (great article
http://www.eggheadcafe.com/articles/20030418.asp) and everything works fine,
however, I think we are going to have problems from our users having to wait
for their cache to clear out before they can login again. Is there a way to
clear the username out of the cache when they logout? I seem to be missing
something here.
rahman
|
|
|
|