|
Thanks for your reply,
I realized after removing those lines from the web.config that new ones errors
come up and they seem to be similar. It cannot load the following files or assemblies:
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
I also tried removing them and then adding the references again!
any ideas?
Thanks!
|
|
|
|
|
Thanks for your reply,
I realized after removing those lines from the web.config that new ones errors
come up and they seem to be similar. It cannot load the following files or assemblies:
add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
I also tried removing them and then adding the references again!
any ideas?
Thanks!
|
|
|
|
|
VS2005
I'm working on a web site that is working on the server on which it resides. It is completely undocumented, and has very few actual comments. I have not yet modified any of the code. However, when I try to run the site, I get the following:
<%@ Master Language="C#" EnableTheming="false" AutoEventWireup="true" CodeFile="mp_Main.master.cs" Inherits="mp_Main" %>
The error I'm getting is: "Master" is not a valid attribute of element "Page". Keep in mind that the line of code above is the very first thing in the file.
Secondly, the compiler is telling me it can't find a file, yet the file exists just plain as day.
WTF is going on here?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
mine reads:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SlaSyConOSNL.master.cs" Inherits="SlaSyConOSNL.SlaSyConOSNL" %>
|
|
|
|
|
I am using Asp.Net 2.0 (c#) and SQL2005.
I have a simple table with following info:
Column 1: bigint - unique id count field
Column 2: varchar - name of organisation
Column 3: DataTime - date record added
I basically need to show those records that are still valid. By valid i mean those records which have have an input date (column 3) of upto 2 years ago. Once the input DateTime is more than 2 years ago the record should no longer be shown.
Please can you give me help / ideas / info on how i can acheive this.
Many many thanks in advance!
|
|
|
|
|
In T-SQL this is one of the possibilities:
declare @date as varchar(15) <br />
set @date = '2008-04-15'
select * from myTable where Datetime >= convert(varchar(15),cast(@date as datetime),102)<br />
and datetime<= convert(varchar(15),(cast(@date as datetime)-365*2),102)
instead format date 102 use ur according format
Hope it helps...
I Love T-SQL
modified on Tuesday, April 15, 2008 7:20 PM
|
|
|
|
|
Thanks for the help!!!!!
However my SQL knowledge is limited, and i dont know what you mean about '102 date format'.
My dates arebeing stored in the format: '15/04/2008 00:00:00' eg Month/Day/Year.
Which code do i use for this?
Thanks again.
|
|
|
|
|
The 102 datetime format gives u this format yyyy.MM.dd
Try to run that code on Query Analyzer and see if it is according to your need, if not then fell free to ask
I Love T-SQL
|
|
|
|
|
Hi,
Ive tried running it and im getting absolutely nothing back. Ive updated the SQL as such for my table/data:
declare @date as varchar(15)
set @date = '2008-04-16'
select * from tbl_QualityStandard where qs_Start >= convert(varchar(15),cast(@date as datetime),102)
and qs_Start <= convert(varchar(15),(cast(@date as datetime)-365*2),102)
|
|
|
|
|
do u have recoreded data in qs_Start column:
qs_Start<br />
2008-04-16<br />
2008-04-15<br />
2008-04-14<br />
2008-04-13
or
qs_Start<br />
2008.04.16<br />
2008.04.15<br />
2008.04.14<br />
2008.04.13
or write me how u have inserted data in qs_start column
I Love T-SQL
|
|
|
|
|
Hi,
My date format is:
15/04/2008 eg day/month/year
|
|
|
|
|
try this
declare @date as varchar(15)<br />
set @date = '2008-04-16'<br />
select * from tbl_QualityStandard where qs_Start >= convert(varchar(15),cast(@date as datetime),103)<br />
and qs_Start <= convert(varchar(15),(cast(@date as datetime)-365*2),103)
I Love T-SQL
|
|
|
|
|
I do transaction in the business layer, and I use EntLib's DAAB.
This gives me some problems, namely a InvalidOperationException: "ExecuteNonQuery requires an open and available Connection. The connection's current state is closed."
I've tried both using the TransactionScope, and the ServiceConfig way of doing COM+ transactions.
It works fine without the transaction stuff.
I'm well aware that the connection gets closed since I do transaction from the business layer, but that should be possible, even if it then becomes a distributed transaction.
As I mentioned I'm also using the Enterprise Library Data Access Application Block, and Im'm wondering if that's what screwing things up.
Any good advice?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
I solved it! After a days worth of hair-pulling
Apparently, DAAB v 3.1 closes the connection so you don't have to, and when I did so explicitly it got messed up.
I guess it's just a good case of "you create it - you close it".
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
I have dynamic links in a GridView. When the LinkButton Text has certain value e.g. "None", I want to disable them. Initial display is right - as Im using this code in the Page_Load:
for (int i = 0; i < gvStatus.Rows.Count; i++)<br />
{<br />
lb = (LinkButton)gvStatus.Rows[i].FindControl("lnkAction");<br />
if (lb.Text == "None")<br />
{<br />
lb.Enabled = false;<br />
}<br />
}<br />
When the GridView PageIndex changes though, the links show up as Enabled, So I put the same code in the Page_Load's if(Page.IsPostBack) and also GridView's OnPageIndexChanged event handler, still does the same.
I believe, part of the problem is, I am using AJAX UpdatePanel.
Any ideas?
Thanks
|
|
|
|
|
I got it done by using the code in the RowDataBound event handler.
Thanks.
Ekjon
|
|
|
|
|
It is the only place to do such actions.
|
|
|
|
|
Hello All,
A confusing issue (for me anyway) came up while trying to utilize a GridView on a page. I have a drop down list that contains a value that is used to perform a stored procedure via my SQL DataSource and then bind the results to my GridView. Slick as can be with hardly no coding as you all know.
Here is the issue though, I am trying to display a count of the results on the same page but for some reason, I get the previous page count. For example, on the first page load there are 5 results, the label displays 5. If I select another option from the dropdown and I know there will be no results, the label still displays 5, but if I select another option where there are results, the label displays 0. How is it that I am getting the previous count and not the current count?
So, my question is, how do I get the current count on each submission? Thank you in advance for any offers of help.
|
|
|
|
|
You can use ViewState to store the count. To display it on the label, get the value from the ViewState - If I understood the problem right.
|
|
|
|
|
What code have you written in the selectedIndexChanged Event from the gridview?
|
|
|
|
|
I haven't put any code in the SelectedChangeIndex Event. I only have this:
this.Label3.Text = this.GridView1.Rows.Count.ToString();
in the Page_Load event.
And as far as the ViewState recommendation, I don't see where I can apply that to the GridView. I am wondering if I can't get an accurate count because I am not using a datatable(?). I am just using the stored procedure call in the SQLDataSource component to bind directly to the GridView. Could this be the reason.
|
|
|
|
|
In your aspx you can say:
AllowPaging="true" OnPageIndexChanging="GridView1_OPIC"
in your codebehind it would be something like:
protected void GridView1_OPIC(Object sender, GridViewPageEventArgs e)
{
this.Label3.Text = this.GridView1.Rows.Count.ToString();
}
|
|
|
|
|
This is a great start! I tried this but I don't think I hit the code when the paging limit is not reached. I therefore am trying to run the same at the GridView DataBinding event, although I cannot find the actual EventArgs for this particular event. But I'll keep digging.
Thank you everyone for you help.
|
|
|
|
|
Somewhere in your code you state GridView1.DataBind();
when that is done you should be able to fill your label with the appropriat value.
You should aslo be able to acces GridView1.FooterRow object. Maybe that could help you in the right direction.
|
|
|
|
|
Hi,
I would like to find a specific location in an xml file and change the value dynamically using an input value from a user.
My file looks something like this:
<sub1>
some text 1
<sub2>
some text 2
e.g I would like to go to some text 1 and replace it with a textbox value.
I need a method which goes into a .aspx.vb file without using XSLT.
Cam anyone please help me?
Thank u in advance
|
|
|
|