|
Ok now my time search isnt working...
You enter lets say: 1/1/2008 and 5/5/2008 and click a button.. here is the command:
SqlDataSource1.SelectCommand = String.Format("SELECT * FROM [Clipboard] WHERE [Date] Between {0} AND {1}", Convert.ToDateTime(txtBeginningDate.Text), Convert.ToDateTime(txtEndDate.Text));
But I get an Incorrect Syntax at 12?
|
|
|
|
|
in the sql server. in the "Clipboard" table...what is the data type of the "date" column...
actually change of plans try this.
SELECT * FROM [Clipboard] WHERE [Date] < {0} AND [Date] > {1}
or
SELECT * FROM [Clipboard] WHERE [Date] > {0} AND [Date] < {1}
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
modified on Wednesday, May 21, 2008 12:30 AM
|
|
|
|
|
Hey! Yes I have the Date column set to: DateTime.
It actually wants the Date and the Time but I am fine with that.
It doesn't have an option for just the date.
Anyways what I did was that I forgot the: " ' ' " between the beginning and ending dates.
Like I did it like this: Where [Date] Between {0} AND {1}
and it should of been: Where [Date] Between '{0}' AND '{1}'
it works though. thanks!
|
|
|
|
|
i can't believe i didn't even notice that. i should have known better.
it was late
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
lol! Its always the easiest problem that is the solution isnt it lol
|
|
|
|
|
hi Jacob Dixon,"Ok in the dialog for the update command it has the command for updating the fields. So when you click update in the grid view where are the commands that make it update? It will not update. When you change something and click UPDATE it just goes right back to what it was." for this please check the isnotpsotback property is given in Pageload event or not .
|
|
|
|
|
jgasm had me do something and it works great now. It was a DataKeyName value in the GridView code. I didn't have one set when I should of had it set to my ID Column.
As for the date/time thing I have figured it out. Thanks!
|
|
|
|
|
I have a simple login form that uses a master page. Im having a weird problem where when the login button is clicked the code behind cannot see the txtUserName.Text
The text box html is
<asp:textbox id="txtUsername" runat="server">
The code behind is
Dim currentUser As New DAL.AppUser
currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text)
If currentUser.AppUserId > 0 Then
....
When I set a breakpoint at currentUser =... I see txtPassword.Text value but txtUsername.Text shows "" even though it is filled.
I checked that its view state is enabled. Tried deleting it and re-adding. Very weird.
Has anyone ever had this problem?
|
|
|
|
|
Try capital ID and make sure the ID value is unique on the page
<asp:textbox ID="txtUsername" runat="server" />
Wait, nevermind, you're using VB, could be anything then.
led mike
|
|
|
|
|
Dim currentUser As New DAL.AppUser
currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text)
If currentUser.AppUserId > 0 Then
=====================================
where is this in the code behind? is this on page load? or page init?
when the page is submit and then loads those text boxes will be blank when the code goes for them.
also when you step through the application and you go one step past the txtUsername, what is the value then? is it still "" for currentUser?
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
The code behind is on login.click button event
|
|
|
|
|
if i had to guess it's because the page is posting back to itself when "login" is clicked and then you're code to collect the information is processing after the post back.
otherwise...i have no idea
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I tried setting AutoPostBack to true and setting a string var on the txtUesrName_TextCahnged event but it show TxtUsrName.Text as NULL also so I am pissed at this point. Its a copy of another site that works fine. It must be some corruption in the asp page.
|
|
|
|
|
I think it's asp:TextBox, does the other one work with this capitalisation ?
Do you have code that sets the username value anywhere, such as page_load ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I rebuilt the whole page and problem fixed.
|
|
|
|
|
Hi,
I am working on this web application that needs to allow the user to upload files. The problem I am having is that when I upload a file with a pound sign, and try to access it I get an error. For example, the file 'AMS.doc' would upload fine to the server and when I try to download that file when it shows up in my grid, everything will go as expected.
However, if I rename the file to 'AM#S.doc' and then upload it, it will get uploaded to the server and the file name will get saved to the database, however, when I click to try to download that file, I get an error message. Is there a way to fix this? I have tried Server.UrlDecode and Encode, as well as HtmlEncode and decode, and none have fixed the issue.
Thanks,
TheMajorRager
|
|
|
|
|
What kind of error are you getting? Are you sure it is trying to access it the same way it is stored in the database? Sometimes when you pull things out of the database, if it thinks there is a SQL Injection risk, it will stop reading.
It would help to get an error message, and some relevant code...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi all,
I have many Messages in web.config file:
for example:
1-Could not find schema information for elemect
'http://schemas.microsoft.com/.netconfiguration/v2.0:configuration'
2-could not find schema information for attribute'name' here:
<add name="FirstName">
3-and etc...
why these messages occure?
Is these messages a reason of that i can not connect to my database?
thank you,
Hoda
|
|
|
|
|
They could be, and probably are. All files should have no issues if you expect to be able to have everything work.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
This does not affect your connection to the database.
This has to do with the version of .NET your web config is calling for and the .NET configuration that's actually installed.
Is this web config left over from a beta .NET version?
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
Hey guys,
Using C#: To hide a column in my datagrid I'm using the code
grid1.Columns[4].Visible = false;
The column I am hiding is a bound column. Is there a smarter way to go about this rather than using an index number to hide the column since it will no doubt come back to bite me when I need to add/remove columns from my grid in the future.
Thanks for your help.
~Chris
|
|
|
|
|
are you auto-populating columns?
you could always customize the "Select" command in the data source and remove in unnecessary fields being entered in.
you can do this in the menu's or right in the .aspx code.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I'm not auto-generating the columns in this instance, but if I was, I understand what you're saying.
So in my case here, am I stuck using a hard coded number to hide my column or is there a way to programatically find the column number of the column I want to hide?
Thanks again.
|
|
|
|
|
if you want to hide it without doing it hardcoded...why not just take out that column from the result set that the grid shows. you could still use a where clause against the data.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
The columns are defined before runtime so I can't take it out of the result set.
|
|
|
|