I have a field of type smalldatetime in a sql table. through a webform, i am trying to insert a blank value(i.e. through A blank text box) but its showing an error that the" value can not be recognized as valid date time". I am using a textbox to insert value to this field. but that text box can also be blank sometimes. plz help.
I want to compare smalldatetime values in my db to a calendar date. I'm not getting any value from dr[0] when I debug and put breakpoint in code below. Same thing if I select 'dateStart' instead of 'count(*)'. Any ideas?
I have a database that has several timestamp fields. One is addTime, another is editTime, and the final one is subTime. depending on which part of the web application the user uses, it will update one of these fields. I know in a sql command in the code behind you can use the getDate() function to populate a value, but will the sql command automatically parse it to the SmallDateTime datatype in the database?
I have the following problem: I need to store in MS SQL Server 2005 a vary large text in to one field of type nvarchar(MAX), In spite of the configuration is apparently correct I keep receiving the following message in the exception: "string or binary data would be truncated".
I have a SQL Server table with a number of fields that are defined with the "Float" data type. I'm running a simple query to retrieve the data from this table and use it to populate a Data Table in my C#.net application.
I just discovered that the data type of the Data Table fields is Double, not Float as I expected. As such, when I store a value like 0.157 it ends up getting stored like this: 0.15700000524520874
I'm aware that such extra "noise" occurs when such a conversion occurs. My major question has to do with why .Net didn't set the Data Type to Float (ie. Single) when the table was first populated?
I need to remember expanded (or) collapsed toggles sections and on page reload I have show them as is expanded (or) collapsed.
[code]....
Now My question is: How to store multiple values (.subCategory id) in hidden field when I click on toggle?. also How to parse them back and iterate them get ids and show toggles?.
I must be doing something wrong, but this makes sense to me. I have a Listbox loaded with tons of items from a datasource. A user clicks one of these items it grabs the selectedindex (an integer) and stores it in a HiddenField (works fine).
Now when the page does a complete a refresh (after postback) I want the ListBox to go back to that selectedindex that is in the HiddenField. Problem is, it seems that after postback the HiddenField is empty? Then I thought about storing the value in an Integer variable in code, but that is simply coming up as a zero at all times.
Question 1: What is the best/simplest way to do this?
Question 2: How?
I am currently grabbing it on selectedindex change
While i was writing a piece of code in C# using ASP.NET i needed to create a message queue to store fault messages. However, I couldn't find the System.Messaging namespace in the namespace library in Visual Studio 2010. Does anyone know how can I use message queuing now?
I have a clean installation of Windows 7 with VS2010 RTM and am trying to get the ASP.NET Development Server to work. When I run the project, the WebDev server starts and shows that it's listening on port x on localhost. I've tried:telnet to the port. The port is not listening. running netstat -o shows that the WebDev server is in fact not listening on any port. manually changing the WebDev port to a different port and restarted VS without effect. I have Windows Firewall turned off entirely and am not running any other firewall software either.
To the hyperlink field I wish to add data from external date, and I have tried this, but it doesn't work,
Code: Protected Sub Gridview1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Dim test As String = Request.QueryString("lang") For Each row As GridViewRow In GridView1.Rows If row.RowType = DataControlRowType.DataRow Then Dim grdviewLink As HyperLink = DirectCast(row.Cells(0).Controls(0), HyperLink) grdviewLink.NavigateUrl += "&lang=" & Convert.ToString(test) End If Next End Sub
I will add the code lang to the URL including the querystring
i want to insert null in smalldatetime column, when user doesn't select any date from the calender control i want to insert null in the databse, i am using typed dataset in my application.
here's my code
[code]....
it gives me the exception "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
Not a fan of creation and modifcation data in each table's row but I don't make the rules here. Something about normal comes to mind. Simple method to insert or update data in a table ia EF. Datatype = smalldatetime and no it is not changing across schema. Don't care about milli seconds. In oOrg = null I always fail because of a datatype mismatch.Not sure but didn't M$ make both of these products, and shouldn't the EF know about a smalldatetime when it reads the schema? So what is the fix outside of changing many tables to be datetime which is frowned upon at this piont.
public static String updateOrgs(Orgs org, Guid user) { using (ELogs2Entities EL = new ELogs2Entities())
I have a text field that users enter information into a database (SQL Server). They are entering as little as a few sentances to multiple paragraphs. I can successfully display the data on my webpage, but the text field is not formatted very nicely. The output is all smashed together like one big paragraph. Ironically, when I also display the text as a tool tip it outputs as multiple paragraphs like it was entered. How can I format the output in the datalist to create a more readable text field? My datalist field is as follows:
Actually I have a gridview with many rows and I want to insert the all rows in sql server through one store procedure first row can inserted but what should we do for other rows
I need rft server control not HTML based server controls to display and store text as well as images, from which i can get rtf text and can save it as it is in DB.