|
Dear
Here is the code
cm.CommandText = "select * From News"
dr = cm.ExecuteReader()
If dr.HasRows = False Then
Label2.Text = "No News..."
End If
Do While dr.Read
'here is the problem, I need the data for the last record
' and this code gives me the first one
Label2.Text = dr.GetString(1)
Label3.Text = dr.GetString(2)
Label4.Text = dr.GetString(4)
Label5.Text = dr.GetString(5)
Label6.Text = dr.GetString(7)
Label7.Text = dr.GetString(8)
Loop
Regards...
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Well, like I said, fix your code. You are selecting news without specifying any sort order. I assume they will come out by Id. So, select by Id in descending order. If you don't have an Id, add one.
This code is bad on a number of levels, I would recommend you do some reading on things like writing a proper data layer, giving your variables proper names so that your code is maintainable, etc.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanks alot
it works
luv ya **
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
iam having a linkbutton where i wrote some javascript for that using onclientclick.even when the button is in disabled mode also the javascript
is firing how to stop this
|
|
|
|
|
Why don't u write on Page load ...........
<br />
LinkButton.Attributes.Add("onclick","Your JavaScript");<br />
instead of using onclientclick,
Did u disable the button in Code Behind?? In that scenerio sometimes it does not recognise enable/disable in JavaScript
|
|
|
|
|
Hi
I am working on ASP.net application and using AJAX.net.
if i am runing my application on firefox then my page_load is being called when I click on button (that calls ajax method )
while with IE its working fine (not loading the page again).
is there any work around for this......
Thanks
Dinesh Sharma
|
|
|
|
|
Firefox supports AJAX, so it's hard to know why the writers of the AJAX.NET library would make this happen. One would assume that the workaround is to write your own AJAX code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi..Every one..
Have anybody implement galileo webservice for flight integration...
I am facing problem for domestic airline....
It is not returning domestic airlines....
|
|
|
|
|
If you're connecting to a specific webservice, why not read their docs/check their forums/etc ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi all...
I am making a web request to a site & all is working fine. But today i found that the site url isnt working. Site is unavailable due to some reasons. So then in my code i am getting error of "Unable to connect to remote server". My code is as follows.
private WebRequest _request;
_request = WebRequest.Create(uri[j]); // uri[j] is an array containing site url
_request.Method = "POST";
_request.ContentType = "application/x-www-form-urlencoded";
_request.ContentLength = buffer.Length;
PostData = _request.GetRequestStream(); <---- gives error
PostData.Write(buffer, 0, buffer.Length);
How can i catch this exception? Is there some way to catch such exception??? Thnx in advance..
|
|
|
|
|
This is plainly not an ASP.NET question.
Have you tried putting this code in a try/catch block ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Does your remote server working properly ? is it pinging ?
cheers,
Abhijit
|
|
|
|
|
Hi
Best Regards
Rajesh Kumar Chekuri
www.rajeshchekuri.co.cc
www.funnudotnet.co.cc
|
|
|
|
|
Depends, you could make AJAX calls, or you could just send a list of ads to the client and have it run in javascript.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I want to add Hit counter to my site. I found few ways to do it:
1. Free hit counters - Problem is it adds site's links/signature.
2. Hit counter using file based storage - File can be crashed when lots of concurrent hits.
3. Database hit counter - Slowdowns the page load.
What is best way to implement it. It's my intranet company site where I need to do it.
Any suggestion from the architecture point view?
Thanks.
|
|
|
|
|
It's trivial to do. Make all your pages derive from a base class which increments your counter. Just use locking to ensure that you only have one thread accessing it at a time.
A db write is not going to slow down your page.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Christian,
Do I need to use Application/session variable for this? I do not want to keep it increasing for a single user, when he refresh page each time.
|
|
|
|
|
Oh, you want it per user. Then you need to use the session start event.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
protected void txtNamesearch_onKeyPress(object sender, EventArgs e)
{
if (e.keyvalue == 13)
{
if (txtNamesearch.Text.CompareTo("") != 0)
{
try
{
DataTable dtresult = Updatemember.GetMemberList(txtNamesearch.Text);
if (dtresult != null)
{
if (dtresult.Rows.Count >= 1)
{
GVUpdatemember.Visible = true;
GVUpdatemember.DataSource = dtresult;
}
else
{
GVUpdatemember.Visible = false;
}
}
}
catch (Exception ex)
{
}
}
else
{
}
}
what is the error in this programme
|
|
|
|
|
Well, the header you used was ridiculous, the code sucks in all sorts of ways - how about telling us what the code is supposed to do. I doubt it's even ASP.NET code, I've never seen anyone silly enough to do a postback on a key press.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
Every Body
I want Upload & Crooping Image like Orkut In Asp.net2.0 or Asp.net3.0.
If anybody knows please help me with Source code.
Thanks & Regards,
Sree Reddy.
sree reddy
|
|
|
|
|
You can't do that in ASP.NET. I think you need to do some reading and understand what ASP.NET is. It's a HTML/javascript/css engine. That won't do what you want. you need an applet for that.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
hai frends
i am using asp.net 3.5
i am scanning a document...i want to exactraxt content in to text formate
by using asp.net with c#
is posible..?
any sites for reference..
any sugessions
very urgent please
|
|
|
|
|
Why is it that no-one on this site knows what ASP.NET is ?
You can scan a document, externally to your ASP.NET website, and then use ASP.NET to submit that document to your server. Then you can buy an OCR component if you want to use OCR to extract the text. ASP.NET has almost nothing to do with any step of this process.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|