|
Hi All,
I have one stored procedure which returns 2 tables.I m using Sqldatasource to bind gridview but sqldatasource binds only first table's data. but i want to access second table also, so give some advise.
Thanks in advace,
Rana k.j.
|
|
|
|
|
Well, datasource property take only 1 table. It seems that you have some kind of parent child grid. In that case you have to add a relation between two tables. And on rowdatabound you will have to get the child control from the grid and bind the child control by getting the child records by createchildview command. If you don't have parent child grid then you need to have all data in one table. You can merge tables before biding the grid or you can get one table from the stored procedure using the union command.
-----
|
|
|
|
|
Hello Mr. SABhatti,
Thank u very much for reply.
well as i write in my previous post that i write one stored procedure which returns two tables. First table binds to gridview and second table's fields values assign to different different labels in my page. There is no relation between this two table.
Rana k.j.
|
|
|
|
|
if you just want to access the second table in dataset you can do that like dataset.Tables[1].Rows...
-----
|
|
|
|
|
1. Here I used master page.In that master page when I click on any hyperlink the total page is refreshing I dont want like that.
2.When I select any item in dropdownlist then also the page is refreshing I dont want like.
Is there any solution to come out from this problem.
Regards
T H kishore
|
|
|
|
|
kishoregani wrote: Here I used master page.In that master page when I click on any hyperlink the total page is refreshing I dont want like that.
You can't change the default behavior of a link. When a link is clicked, browser will move to the specified location.
kishoregani wrote: .When I select any item in dropdownlist then also the page is refreshing I dont want like.
Set AutoPostBack=false for the control
|
|
|
|
|
You can use a span in the place of a link with a style of underline and use the javascript onclick even to handle the click.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
In the site I have a file to store an integer.In a asp.net page I have I read this file and let the user create a record in the database table and after addition the integer in the file is increased by one. I need the integer stored in table to be unique. What I worry about is if multiple users open the same page and both will have the same integer(read from file). Should I use lock for the file ? What is your recommendations ??
|
|
|
|
|
If you only want the id in the database table to be unique, that's best handled in the database.
Set the field in the database to be identity , counter or auto_increment , depending on the database you are using.
After you have create the record in the database, you can get the identity that was created, for example using "select scope_identity()" if you are using MS SQL Server.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Guffa wrote: Set the field in the database to be identity
My table already has an identity column. is it possible to create two identity columns for a table ?
|
|
|
|
|
No.
Create a new table with just an identity field, and use that to create unique values, instead of trying to use a text file.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
i need to add an icon to my web pages i used the following
but it did not work
please advice,
thanks in advance
abdelhameed81
|
|
|
|
|
abdelhameed81 wrote: but it did not work
It depends on browser. I think IE7 onwards displaying this. IE6 won't display this
|
|
|
|
|
Minor correction: IE6 will show it if you bookmark it and then revisit the page. Which is a bit rubbish.
Cheers
Ben
|
|
|
|
|
Hi
I'm working with webparts controls.I have created a declarative catalog part and placed a dropdownlist to that catalog also have added some three items to that dropdownlist during design time. But in run time when i add that dropdownlist from the declarative catalog to a webpartzone. The control alone get's inserted the items added to it during design time are missing.. Why is this happening....?
-- modified at 9:44 Tuesday 23rd October, 2007
Regards
Sivan.G
|
|
|
|
|
I designed a webpage in asp.net with c#,for online shopping.in that the list of products(images) are displayed.at first the images size are small in size. when the user move the mouse over the particular product, the particular product image size should be en-large and it is shown as big image. how it is possible. please help me.
jai prakash
|
|
|
|
|
|
thanks navaneeth.
jai prakash
|
|
|
|
|
Hi,
I am trying to repeat image in word (containing HTML) for some table cells. But the image is not displayed in MS Word. It displays in IE / other browsers. I am using background-image and repeat x for this.
I searched for the same and found that background images are not supported in MS Word. Is there any workaround for this.
Thanks !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hi Guys and Gals,
I am using a javascript function to update a label in a template column of a gridview. This all works fine, but the problem we are having is that when we want to update the database with the changes, the labels returns the old values instead of the updated values in the labels.
Here is our JavaScript. If anyone can tell us what we are doing wrong or how to correct this problem, it will be greatly appreciated.
string script = @"
function calcQty(QtyPerCarton,Cartons, num)
{
if(num < 10)
num = '0' + num;
var i = document.getElementById('dg3_ctl'+num+'_txtCartonsPicked');
var carPicked = i.value;
var out;
if(carPicked <= Cartons)
{
out = parseInt(carPicked * QtyPerCarton)
}
else
{
alert('Cartons Picked cant be greater than Cartons');
return;
}
var lbl = document.getElementById('dg3_ctl'+num+'_lblQtyPicked');
lbl.innerHTML = out;
}
";
this.RegisterStartupScript("Calc", script);
Kind Regards,
Elizma
|
|
|
|
|
Use this:
lbl.value= out
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
It doesnt work! Visual Studio generates tags in the html output, thus it will not contain the value attribute but only the innerHTML attribute which does not change or update the old value with the new value.
Any ohter suggestions?
Kind Regards,
Elizma
|
|
|
|
|
if lbl is not a server side control then how you can access it server side in code behind for save to the Database?
Note: you can once more test with lbl.innerText=out;
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
My Label is a Server side control since it's a Template field of the GridView. The code I am doing is in Javascript that updates the values client-side. Unfortunately the client-side values does not get sent back to the server for saving.
Tried innerText as well. Still not working.
Regards,
Elizma
|
|
|
|
|
What do you want exactly? Do you those values prepared by JS to the updated in DB?
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|