|
I guess DataBinder.Eval with serch with in the GridView's Data source to find out the value. You may also try putting the hyperlink in a hidden filed and do like this ( say the hidden field name is txtHidden )
<asp:hyperlink id="hlink" runat="server" navigateurl="'<% = txtHidden.Value %>'">Download Here </a>
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Thanks everybody for replying the problem is solved...........
|
|
|
|
|
Hi, I am writing a stored procedure in SQL server 2005, and when I want to save it gives me two mistakes for @AddedDate and @ArticleId. Any Help??? Thanks Ahead, below is my stored procedure:
CREATE PROCEDURE dbo.tbl_Artikl_InsertArticle
{
@AddedDate datetime,
@AddedBy nvarchar(256),
@CategoryID int,
@Title nvarchar(256),
@Abstract nvarchar(4000),
@Body ntext,
@Country nvarchar(256),
@City nvarchar(256),
@ReleaseDate datetime,
@ExpiryDate datetime,
@Approved bit,
@Listed bit,
@CommentsEnabled bit,
@OnlyForMembers bit,
@ArticleID int OUTPUT
}
AS
SET NOCOUNT ON
INSERT INTO tblArtikl
(AddedDate, AddedBy, CategoryID, Title, Abstract, Body, Country, City, ReleaseDate, ExpiryDate, Approved, Listed, CommentsEnabled, OnlyForMembers)
VALUES (@AddedDate, @AddedBy, @CategoryID, @Title, @Abstract, @Body, @Country, @City, @ReleaseDate, @ExpiryDate, @Approved, @Listed, @CommentsEnabled, @OnlyForMembers)
SET @ArticleID = scope_identity()
|
|
|
|
|
|
When I did that, I solve that problem but now I have a new error:
for CommentsEnabled and OnlyForMembers, it says Invalid Column Name.
in the table they are declared like [Comments Enabled] and [Only For Members]. Is there any difference, cause I declare them like [Comments Enabled] and [Only For Members] in the stored procedure as well, and it gives me the same mistake.
CREATE PROCEDURE dbo.tbl_Artikl_InsertArticle
(
@AddedDate datetime,
@AddedBy nvarchar(256),
@CategoryID int,
@Title nvarchar(256),
@Abstract nvarchar(4000),
@Body ntext,
@Country nvarchar(256),
@City nvarchar(256),
@ReleaseDate datetime,
@ExpiryDate datetime,
@Approved bit,
@Listed bit,
@CommentsEnabled bit,
@OnlyForMembers bit,
@ArticleID int OUTPUT
)
AS
SET NOCOUNT ON
INSERT INTO tblArtikl
(AddedDate, AddedBy, CategoryID, Title, Abstract, Body, Country, City, ReleaseDate,
ExpiryDate, Approved, Listed, CommentsEnabled, OnlyForMembers)
VALUES (@AddedDate, @AddedBy, @CategoryID, @Title, @Abstract, @Body, @Country,
@City, @ReleaseDate, @ExpiryDate, @Approved, @Listed, @CommentsEnabled, @OnlyForMembers)
SET @ArticleID = scope_identity()
|
|
|
|
|
IF this is the name in the table "[Comments Enabled]", then that is the name you have to use. Are you sure you didn't have a typo when youtried to put them in?
|
|
|
|
|
I solved. Thx for the help. Have a nice day
|
|
|
|
|
Hi,
Iam stuck with how to use XML web service from my ASP page.
In .Net i was using the web wervices by using 'Add Web Reference' but in ASP i didn't find any such thing.
I want to know how to call web service from ASP.
|
|
|
|
|
ASP questions should be posted in the Web Development forum.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hai
I need a help to access an <asp:dropdownlist> selected value which is placed inside an update panel.This DropDownList is inside a table. for that i have a code like this
foreach(HtmlTableRow tr in purchaseDetails.Rows)
{
foreach (HtmlTableCell tc in tr.Cells)
{
foreach(Control ctrl in tc.Controls)
{
if (ctrl is DropDownList)
{
}
}
}
}
but i cant access this DropDownList
Please help me
|
|
|
|
|
sorry what do you mean you can't access it?
wouldnt you just have
dddropdownlist.selectedvalue like that?
|
|
|
|
|
Why you have to take this much of pain to access a dropdownlist inside a UpdatePanel. It can be accessed similar to a normal drop down list
selectedValue = DropdownList1.SelectedValue;
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
I have a table with one field primary key.when i added data into the table i retrieve the id of the last added data and bind the data into a grid.I want to retrieve the rowindex of the last added data using the id.
|
|
|
|
|
DataView view = new DataView((DataTable)gridView.DataSource);
Your row index = view.Find(key);
Here key will be your primary key.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
I given like that .but an exception of object refrence is not is occured.The code is attached below.
DataView v = new DataView((DataTable)Gdv_Dept_List.DataSource);
int row = v.Find(outstatus);
here outstatus is the retrieving primary key.pla help and sort out the problem.
|
|
|
|
|
object reference usuauly means you have referenced something either doesnt exist at all or hasnt been set yet
|
|
|
|
|
Please sort out the problem through the code.
|
|
|
|
|
What value should be set for object refrence in this case.plz help me its urgent..
|
|
|
|
|
i'm not sure, try commenting out bits of code and see what happens then you might find the line of code that is causing the problem, then post that on the forum
|
|
|
|
|
I have used AJAX Calender control to select date and now i want to use this date which is going to send to the SQL Server2005 database for processing.
How can I convert the datetime from the text box i.e. in string format returned by AJAX calender control to ASP.NET2.0 DateTime so that I can pass this to SQL Server2005?
Thanks in Advance
|
|
|
|
|
ASP.Net dateTime ???... You can convert a text to DateTime by writing
DateTime.Parse(string);..In your case DateTime.Parse(txtDateBox.Text) or something.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
I have used
1) DateTime dateFrom = DateTime.Parse(txtFromDate.Text.Text);
2) DateTime dateFrom = DateTime.Parse(txtFromDate.Text,System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat);
3) DateTime dateFrom = Convert.ToDateTime(txtFromDate.Text.Text);
4) DateTime dateFrom =(DateTime)txtFromDate.Text.Text;
But these all are not working.........
giving error
String was not recognized as a valid DateTime.
But when I hardcode the date as
DateTime dateFrom = new DateTime(2008, 2, 28);
it works perfectly.....
|
|
|
|
|
What is txtFromDate.Text.Text ?. It should be only txtFromDate.Text. And are you getting this error from after you execute the query or while converting ?..
You may try changing dateFrom to dateFrom.ToShortDateString() before inserting to DB if the error is from the second case.Just to ensure that it trims off the time part.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Hey it was typographical mistake here but i have wrote txtFromDate.text in the code
|
|
|
|
|
It was getting error while passing to the query i.e. before going to the database
and it works fine with
DateTime dateFrom = new DateTime(2008, 2, 28);
|
|
|
|
|