|
Use the DateTime.ParseExact method to parse the string into a DateTime value.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi
i have tried but still have got error.
my code is
IFormatProvider format = new System.Globalization.CultureInfo("en-US", true);<br />
DateTime fromtime = DateTime.ParseExact(TB_Time.text, "HH:mm:ss",format);
Input string was not in correct formate.
plz help me
thanks
Pathan
-- modified at 4:27 Tuesday 12th December, 2006
|
|
|
|
|
That means that the string that you tried to parse does not match the format.
If you need to handle values that might not be correct, use the TryParseExact method instead.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi!
i have a page a.aspx containing a iFrame say iFrm. there are two tabs 1 & 2 on the a.aspx.
on clicking on tab 1, b.aspx page is opened in the frame & on clicking on tab 2 c.aspx page is openned. both b.aspx & c.aspx containg a button GO. on clicking GO a new page E.aspx page is openned using response.redirect. my problem is that whenever i clicked on GO button, E.aspx page is openned in the iFrame of the a.aspx rather than openning in the new window closing a.aspx & b.aspx or c.aspx. please solve my problem.
SAMir Nigam
|
|
|
|
|
i ve one table. i want to display all fields in datagrid.
but i want a colum of count with all these fields.
how to do it in page code
diya
|
|
|
|
|
Two ways to do that.
1. Fetch the column count from the Query. And just bind the whole stuff with Data Grid (Recommended)
2. If you are not fetching the count than you have to add another column in the datatable and loop through each row to fill in the count in it (Not Recommended).
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
i am having a grid that displays a time sheet, which shows whether a person is available or not in this week. To check whether he's committed or free. For that i am using 2 tables, one for the person details and another one to enter the new appoinment for the corresponding candidate.
using that i have combined that two tables and displayed in the datagrid, The first column is the list of names and other 7 columns follow all the 7 days in the week. I have displayed a text (true or false) whether he's available (free) on that particular day or not. But i need to display a toggle button indicating availablility.
How to use the toggle button in the grid and place the suitable image regarding the result ?
Regards,
Abul.
|
|
|
|
|
I'm looking for some references as to what security measures are in place if an asp.NET application/script isn't registred with the server (and therefore is not trusted). Maybe an article on this topic.
the last day or two i've been poring over the code of codeajay's CSV Import/Export app[^] trying to see if there was something i could modify in order to get the import feature to work. I've had no C# experience prior to that but it looks pretty straightforward and i have only a minimal ammount of questions (which i won't bother you guys with since the information should be available somewhere).
I've been trying to trace where a FileIOPermissions error is comming from, but i haven't really seen a direct reference to file permissions in any of the code. So i'm assuming the restrictions are comming from the way GoDaddy has configured their "Windows Shared Hosting" accounts. The odd thing is though, the export feature freely generates a file and stores it on the server. My conclusion is this has something to do with the security side of the asp.NET, barring an untrusted script from reading a newly uploaded file but i can't really verify it unless i write another script that basically does the same thing, uploads a file and then reads it in order to process the data.
The application has its own virtual directory with the "write" permission enabled and the dir set as root for the application, but there's not much i can do with their simple control panel After intense googling i still don't see a way to register the application with the IIS, so i assume they don't provide that.
I hope someone here can guide me in the right direction
Thanks in advance
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
Could someone direct me to a good link that discusses the logic behind paging? I am writing a site that loads images. I want to limit each page to a predetermined amount of images to display at a time. If there are more than that number, I want a link to the next page of results and on the next page, have a link to the previous page ..etc etc.
I know there are controls such as the dataGrid but I am not using anything like that. I am using very basic and minimal code ( hopefully ) by using a simple table. Should I reconsider?
Any advice/links is much appreciated.
Andy
|
|
|
|
|
You could use a repeater control and define the number of columns and rows and add paging links to the footer and/or header template.
There are plenty of examples available for a photo viewer.
only two letters away from being an asset
|
|
|
|
|
Hi folks,
I've been lately trying to expose an object graph (with circular references) through a web method, however, this was not possible since the XmlSerializer has got no idea how to address the issue. Therefore, I've just changed the WebServiceBindingAttribute from
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
to
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
and added the SoapDocumentMethodAttribute to the web methods as follows and the problem is solved.
[SoapDocumentMethod(Use=SoapBindingUse.Encoded)]
The questions:
1. I would like to know this means that I only and only lose the
interoperability? Is this what happens???
2. Is there anyway to solve the circular referencing problem within the
object graph when exposing objects through web methods under the WSI
Basic Profile 1.1 standard?
3. Consider a class (MyEntity) that has got some properties, say Prop1, Prop2 and Prop3 all of boolean type. On the service side, consider this:
MyEntity entity = new MyEntity();<br />
entity.Prop1 = false;<br />
entity.Prop2 = false;<br />
entity.Prop3 = false;<br />
return entity;
When the entity is marshaled to the client, the Prop2 is true, while it's being set to false!!!! What the heck is going wrong with this? What happens when the type is serialized/deserialized???
TIA,
Mehdi
|
|
|
|
|
I've come to a problem in a project I've been working on. I can't believe no one has run into this problem before, but I can't seem to find anyone doing anything like this anywhere. That always scares me and makes me question the methods I have chosen. Here is what I'm trying to do:
I am uploading images for a picture gallery but before images are uploaded I list them with the following information: A thumbnail view of the image, a textbox where a description can be typed, and a checkbox whose checked status will determine whether the image is to be uploaded or not.
My page loads a local directory of images with some other data using an xml file that was created with another process. My goal is to save BACK to the xml the checked/unchecked value from the checkbox and the text that was entered as a description in the text box. The problem I'm running into is generating the checkbox and textbox controls on the fly and still being able access the controls in the post back event.
Has anyone done anything like this? Any help or pointing me in the right direction would be great!
Thanks for your time!
John
|
|
|
|
|
This is basically what I'm trying to do now...
<asp:repeater id="ImageRepeater" runat="server">
<headertemplate>
<itemtemplate>
<footertemplate>
Upload Image? | Image Preview | Image Description | <asp:checkbox id="chk<%# DataBinder.Eval(Container.DataItem, " simagedesc")="" %="">" runat="server" Checked="true"/> | " alt=""/> | <asp:textbox id="txt<%# DataBinder.Eval(Container.DataItem, " simagedesc")="" %="">" runat="server"> |
This gives me a "Server tag is not well formed" error. I get that error from the "<%# DataBinder.Eval(Container.DataItem, "sImageDesc") %>" code where I'm trying to assign the control id's name dynamically.
|
|
|
|
|
If anyone has ANY help they can offer, that would be awesome!
|
|
|
|
|
I have created a usercontrol having a dropdownlist together with other functionality. I need to set the selectedindex of the dropdown from the values saved in the database. Although the value is passing successfully to the set value, however am not seeing the values shown in the dropdownlist. Any ideas? Following is a snippet of my code;
Private _selRequest As Integer
Public Property RequestValue() As Integer
Get
Return _selRequest
End Get
Set(ByVal Value As Integer)
_selRequest = Value
Me.drpPersons.SelectedIndex = _selRequest
End Set
End Property
|
|
|
|
|
Hi,
try checking the page load event of your page that is using this control. see if u have if(!IspostBack) in your page load. or
try to add a public function to set the dropdown in the control.(set property should would be same but still u can give a try)
Regards,
Anil
|
|
|
|
|
I'm writing a web service in .NET that will expose Enumerations to the caller. I know this is possible, I just want to know if it's a good idea. I want to make it inter-operable with other systems, so would exposing an enum work ok? Specifically it will expose a custom object that has an enum inside it as a public property. Many thanks!
PS. to see the web service in action visit http://www.dominicpettifer.co.uk/coolApps/whereAmI.aspx[^]. IP Location mapping, not very accurate though.
|
|
|
|
|
I have created a public custom class which I exposed through a web service before and have not experienced any problems with it. As long as you make sure that you are not exposing sensitive data, you should be okay. About making it inter-operable with other systems, I am not sure. I've never tested that, but in theory I believe it should work.
Hope this helps you.
|
|
|
|
|
Hello,
VS 2005 SQL 2005
I would like to change the connection string dynamcially during program run-time. But get the code to work. There is no run-time errors and the code compiles ok. However, the code does not let me get the connection string, and I would like to update the connection string at run-time.
This is my code in the web.config file.
<br />
<connectionStrings><br />
<add name="ServiceMasterConnectionString" <br />
connectionString ="data source=dev01; initial catalog = serviceMaster; user id=; pwd="<br />
providerName="System.Data.SqlClient"/><br />
</connectionStrings><br />
The code in my website that is used to retrieve the website is as follows:
<br />
imports system.configuration.configuration<br />
<br />
Dim rootWebConfig As System.Configuration.Configuration<br />
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Incidents/")<br />
Dim connString As System.Configuration.ConnectionStringSettings<br />
connString = rootWebConfig.ConnectionStrings.ConnectionStrings("ServiceMasterConnectionString")<br />
incidents is the folder that contains the web.config file. That has a virtual path in the IIS.
Can anyone correct if I have done anything wrong in the code above,
Many thanks in advance,
Steve
|
|
|
|
|
You might want to reconsider placing the configuration information in another database or XML File rather than the web.config.
Also when you change web.config, the application resets and will want to recompile.
|
|
|
|
|
<connectionStrings>
<add name="MyConnString" connectionString="Data Source=localhost;Initial Catalog=MyDB;User ID=**;Password=**;"
providerName="System.Data.SqlClient" />
</connectionStrings>
ConfigurationManager.ConnectionStrings["MyConnString"].ConnectionString
only two letters away from being an asset
|
|
|
|
|
I want to create table at runtime for an existing Ms Access database using ASP.net 2.0 and C#. Can anyone please guide me through it ?
|
|
|
|
|
arpita2006 wrote: ASP.net 2.0
ASP.NET will not help you because that is a technology for web applications. ADO.NET is that part of the .NET Framework that deals with databases.
With ADO.NET you can issue pretty much any commands that the underlying database understands. So you can use OleDbCommand.ExecuteNonQuery() to issue CREATE TABLE commands. You will need to look up the MS Access reference for details of what SQL you need to perform these actions.
|
|
|
|
|
|
Hi,
I am quite OK with using the System.Drawing class to create an image on the fly, but if I want to save it as a .gif image, how do I create/define/set the colour palette to avoid horrible dithereing if I use anything other than "standard" colours?
Any pointers gratefully appreciated
thanks
Fred
|
|
|
|