|
nigel2000 wrote: it will put the row data in to a table
What do you mean? A database table or a HTML table?
What part of the problem are you specifically stuck with? What have you tried to do yourself?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
i am developing a shopping cart, i am using a table from the northwind database to practice with(Products table) i have loaded this table in to a datagrid and have addded a button called "Add" so when the user clicks the button it will put that row into a table which is the cart so then the user can view what he/she is buying.
|
|
|
|
|
Hello all. I have a GridView and a DetailsView which is bounded to the first one, so that when I click in the Grid's "select" command, it shows the related data in the DetailsView. So far, this is working smoothly.
However, now I have a table with two primary keys. I changed the declaration of my asp:GridView tag and edited the DataKeyNames to include both primary keys. So I run the ASP.NET. So far, I have this data:
PK1 PK2 DESC
=========================
1 1 Desc1
1 2 Desc2
1 3 Desc3
where both PK1 and PK2 are primary keys. The grid shows the data correctly. When I select the first item, the DetailsView displays the data correctly. However, when selecting the second or third row, it does not select anything (furthermore, not even the controls --textboxes-- are shown).
So I believe it has something to do with the fact of having two primary keys, even though I specified them in the GridView control.
I'm I missing something here? Has anybody ran into the same problem? A clue? I've googled and so far I've found sites saying that multiple primary keys are allowed, yet they do not remark any particular aspect for doing so.
Thanks in advance.
FG.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
So, I solved it. What I did was to capture the GridView's SelectedIndexChanged. There, I placed the following code:
DataKey dataKey = CatalogGridView.SelectedDataKey;
_detailsDataSource.SelectParameters["IdAtributo"].DefaultValue =
dataKey["IdAtributo"].ToString();
_detailsDataSource.SelectParameters["IdRol"].DefaultValue =
dataKey["IdRol"].ToString();
_catalogDetailView.DataBind();
where _detailsDataSource is the... well, the data source associated to the DetailsView _catalogDetailView . Before this, I had the following declaration of my data source's select parameters:
<SelectParameters>
<asp:ControlParameter Name="IdAtributo" Type="String" Size="5" ControlID="_catalogGridView"/>
<asp:ControlParameter Name="IdRol" Type="String" Size="5" ControlID="_catalogGridView"/>
</SelectParameters>
While this works perfectly when having only one primary key (the GridView passes the selected index to this data source and hence the DetailsView is updated automatically), for some unexplained reason it is not working with multiple primary keys. Thus, I just passed the values manually in the GridView's SelectedIndexChanged and DataBind ed the control manually.
Now it is working perfectly. Notice however that the parameters cannot be of type asp:ControlParameter , but rather they must be simple asp:Parameter .
Thanks anyway.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
A textbox that is supposed to accept comments from users and send it to the db is accepting only 150 char from the textbox no matter how many chars the user enters.I have checked all the properties of the textbox and all the path to the db,sp,components atall.I cannot find where or why all the values are not sent.Please any clue from anybody?
|
|
|
|
|
Did you check how long the field in the DB is ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello All,
I have a boggling question (For myself anyway)
First of all, here is the code.
If Not FILE1 Is Nothing Then
If Not FILE1.PostedFile.FileName = "" Then
Dim sFile As String
'sFile = UID & "_" & Replace(FILE1.PostedFile.FileName.Substring(FILE1.PostedFile.FileName.LastIndexOf("\")), "\", "")
sFile = UID & "_" & FILE1.PostedFile.FileName
'spath = Server.MapPath("\files\") & UID & Path.GetFileName(FILE1.PostedFile.FileName)
FILE1.PostedFile.SaveAs(Server.MapPath("../Files/" & sFile))
sql = "update events set eventfile='" & sFile & "' where eventid=" & UID
myCom = New SqlCommand(sql, myCon)
myCom.ExecuteNonQuery()
Else
sql = "update events set eventfile= '' where eventid=" & UID
myCom = New SqlCommand(sql, myCon)
myCom.ExecuteNonQuery()
End If
End If
The problem is, most machines (All to my knowledge with the exception of one) work fine with this code. They can upload files with no problems, shove the path in a DB, and carry on like normal.
One client cannot. The error she recieves is looking like instead of passing the filename as sole, it is passing her local filepath as well..
Here is the error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
'../Files/210_G:\OH&S Certification Training\Marketing Info\Spring 2008.doc' is not a valid virtual path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: '../Files/210_G:\OH&S Certification Training\Marketing Info\Spring 2008.doc' is not a valid virtual path.
The String '../Files/210_G:\OH&S Certification Training\Marketing Info\Spring 2008.doc' should simply be '../Files/210_Spring 2008.doc'
Any ideas on why this client is having such a problem? All help is greatly appreciated.. and if possible I would email some brewskies.
Thanks in advance.
|
|
|
|
|
Hi,
can anyone help me, i have a page which uses ajax, im trying to print but every time i click print my table(which is a server control) gives me this error message
(Extender control is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().)
can anyone help me?
thanks in advance
living life on the flip side
|
|
|
|
|
Are you using the inbuild extender controls?
If not, have you created your own extender control?
Do let us know this info so that we can move forward..
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
Im using interior controls, its a filterTextBoxExtender.
living life on the flip side
|
|
|
|
|
|
Thanks alot for all your help, i will check out that link now and give feed back.
Thanks a mil
living life on the flip side
|
|
|
|
|
Hi,
i have created a dataset named Dataset1.xsd
i have added a new crystalreport file to my apps named CrystalReport.rpt
i have configured the same with my dataset.
I get the tables n columns of my dataset in the FieldExplorer
I drag n drop the required columns in my rpt file
Then in my webform i drag n drop the crystalreportviewer
and map the CrystalReport.rpt source as the source for viewer.
When i execute i get this...
The report you requested requires further information
Dataset1
Server :Dataset
Database:
Username:
Password:
Integrated Security
and a logon button
can nebody help me???
zari
|
|
|
|
|
Does no body knows whats the pbm??
zari
|
|
|
|
|
Hi,
1. Tell me, when you created your report, did you use the dataset that you created, or did you connected directly to the database?
2. When creating the Dataset, dropping the tables from the database on the dataset, have you deleted the fill objects at the bottom of the table?
3. Have you created an instance of your dataset and fill the tables in the dataset with the code from the database?
4. Lastly you have to set the datasource for this report to the dataset instance that you created and filled.
Let me know if you need assistance. I struggled myself with this in the beginning.
Kind Regards,
Elizma
|
|
|
|
|
Hi friends
I have one table called attributes
Fields like this
ID qty1 price1 qty2 price2 qty3 pirce3 qty4 price4 qty5 price5.....
1 1 20 10 15 50 10 100 8 200 6
If I enter qty 5 thens it returns prices 20 and 15 and if I enter qty 150 it returns prices 100 and 200.
Can any know sql quiry for this?
or
How to do it using code in asp.net if I get all records of each row?
thanks in advance
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi Imran, can you cleary mention your table. I am not able to get it .
|
|
|
|
|
Abhijit Jana wrote: can you cleary mention your table. I am not able to get it .
Look at this
Table Name Attributes<br />
ID 1<br />
qty1 1<br />
price1 20<br />
<br />
qty2 10<br />
prices 15<br />
<br />
qty3 50<br />
prices 10<br />
<br />
qty4 100<br />
prices 8<br />
<br />
qty5 200<br />
prices 6<br />
<br />
qty6 500<br />
prices 4
Now, If I enter qty=5,return prices 20 and 15 (qty 1 to 10)
for qty=75,return prices 10 and 8 (qty 50 to 100)
for qty=250,return prices 6 and 4 (qty 200 to 500)
and so on.....
got it.
Thanks
please don't forget to vote on the post that helped you.
|
|
|
|
|
Are qty1, qty2... qtyN and prices1, prices2... pricesN columns in your database?
|
|
|
|
|
Paddy Boyd wrote: Are qty1, qty2... qtyN and prices1, prices2... pricesN columns in your database?
No. thers are only 8 columns of qty and 8 columns of prices.
please don't forget to vote on the post that helped you.
|
|
|
|
|
I think that you should look at your DB design, for two reasons:
1. You are making this very hard to query for yourself.
2. It's not extensible - what happens if your customer wants to add another quantity band - you add another column and update any sql??
I would suggest that you have a table with your ID (I'm guessing that it's a product table) and then another table like this:
ProductID Quantity Price
Where ProductId and Quantity are the combined PK.
So for product 1 you might then have entries in the above table like:
ID Qty Price
1 10 20
1 30 40
1 40 50
And you then want the price for a band, the select statement would be as follows:
SELECT TOP 1 PRICE
FROM ThisTable
WHERE ID = 1
AND Quantity < 15
ORDER BY Quantity DESC
|
|
|
|
|
try something like this
select Price from Tablename
where qty =(select top 1 qty from TableName where qty<=5) or
qty =(select top 1 qty from TableName where qty>5)
|
|
|
|
|
hi imran try this
select price from attributes where qty in (select Max(qty) as qty from attributes where qty < EnterValue) Or (select Min(qty) as qty from attributes where qty > EnterValue)
harun
|
|
|
|
|
just try this query
select price from attributes where qty in (select Max(qty) as qty from attributes where qty < EnterValue) Or qty in (select Min(qty) as qty from attributes where qty > EnterValue)
harun
|
|
|
|
|
Hi,
I am doing work on a web application in asp.net 1.1. Client want me to place button on web form named as "Burn CD". In simple word he want to burn cd in web application. Let us suppose there is a file on web server. He want to burn that file on CD. Is it possible. Please do help me. If it is not possible then please give me any reference. Thanks in advance.
Arslan Ilyas
.Net Developer
Red Signal
|
|
|
|