Jump to content
Xtreme .Net Talk

vthokienj

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by vthokienj

  1. I am having no luck doing this. The field in the database is set to Date/Time with the format being Short Date. In the C# code i have a DateTime object which i read the date into as a ShortDateString so it only stores the date in the format of 5/27/04. when i go to insert into this field using a query string like this: query = "INSERT INTO tblStorage (dateOfEntry, GsharesOwned) " + "Values ('#" + date +"#', '" +GsharesOwned +"')"; the following error is caught: "data type mismatch in criteria expression". i read somewhere to include a # before and after the date, well it does not work whether these are included or not. the only way i can insert a date is to change the field type to text, then this query string allows me to insert into the date field. my reason for needing the field to be declared a date/time field is so i can sort it based on the date vs having to write my own function to sort if the dates were just strings. how can i insert into a Date/Time field? i am using C# and Access as the database for a windows app. thanks.
  2. i am interested in creating asp.net web appliations that use c# code. is there a particular development tool that is considered easy to use? i have used visual studio but was wondering what others use, whether it be Webmatrix, Dreamweaver, or even just notepad. the problem with studio is i want to make and use user controls, but if i drag them onto the form it will add tables to the code so i can add the control manually but this kind of defeats some of the purpose of using a Studio.
  3. I am using Visual Studio.net to create asp.net web pages. the problem i am having is that if i use different folders for my code and upload it, everything is fine. but the code to reference the folders when run locally through Debug will produce an error. How can you use Studio to develop asp.net apps and be able to debug them? an example of what i mean. in my root folder, i have a default.aspx form that has a button that when clicked, will execute the code Page.Response.Redirect(@"\folder1\default.aspx"); folder1 is a folder that i created in the root directory. so when i upload to my site, this code knows to execute http://www.mysite.com\folder1\default.aspx. but locally this gives an error because it is executing http://localhost/MyProjectName/default.aspx and when i click the button to redirect it would execute http://localhost/folder1/default.aspx of course i could change the redirect code to be Page.Response.Redirect(@"\MyProjectName\folder1\default.aspx"); but then i would have to change this every time i upload. so what am i supposed to do?
  4. i am having a very difficult time figuring how to handle this problem. what i have is a series of inputs that are to be inputted using the same text box on a form. i have a panel on the form that contains the following two items: [labelParamName] [textboxParamValue] [buttonSubmit] i want to go through a series of inputs using this panel. for the first input, i would load the label with the input desired, the user should enter a value into the text box then hit submit. the problem is how do i wait for the user to enter the first set of data before loading the second set of data? i have a function GetInputs() that would be as below: GetInputs() { // for input 1 labelParamName.Text = "data1"; // for input 2 labelParamName.Text = "data2"; // for input 3 labelParamName.Text = "data3"; } so, after all this, my question is how do i code this so that i only proceed to the code for input2 after a value for input one has been submitted and entered via the press of the button? Thanks
  5. I have a project where the startup form will have a bunch of buttons, clicking each one should open up a new form. the question is, how do i do this? lets say form1 is the startup form, and form2 and form3 are new forms that should be displayed, yet also link back to form1. if from form1 i click to go to form2, do i hide or dispose of form 1? also, in the button click method, i would say: form2 frm2 = new frm2(); frm2.Show(); now form 2 is active. but how do i get back to form 1 from here? i no longer would have access to form1, as far as i can see.
  6. slowly i am learning about page templating. i can do stuff like create a table and then add that table to the page controls with Controls.Add(table); how do you format a page though? i want the top to have a menu and the bottom to be a footer. do you create the layout in desing view using placeholders, then add the controls there? i would think that doing it this way would create a site that is inconsistent across browsers. if the answer is to declare your placeholders in code, then how would you specify that the menu control gets loaded into a placeholder at the top of the page, and the footer placeholder is at the bottom? also, if anyone knows how to add a custon control using Controls.Add that would help. i only seem to be able to add user controls.
  7. thanks but i really am looking for a tutorial on templates, not just VB source code. preferably in C#. i guess the search continues, there just doesnt seem to be much available on this.
  8. i am confused as to how a website is coded in asp.net/c# to have a menu bar that is on each page. specifically, i am looking at http://www.asp.net. most tabs that you click still load "default.aspx" then use the '?' to load another page. so i assume the menu is loaded as a control in default.aspx. but when you click, say, the Tutorials tab, default.aspx is not shown to be loaded anymore, it loads "quickstart.aspx" yet the menu bar at the top remains. does this mean they had to load the menu control on the quickstart page as well, or is there something that i am missing. maybe the use of templates? by the way, if anyone knows of a good place to learn about using templates in web design please let me know.
  9. i am creating a site using c#/asp.net and would like to know what the best way to design my site would be. what i want is for each page to have the same menu bar on top of it, with your standard clickable buttons like Home, Contact Us and whatever else. each link would link to its own page. currently, i have one page "default.aspx" and i load a custom control menu to the top of this page. a large area of the default area is a placeholder which i load the content into. so the end result is that default.aspx is always the web page that is loaded and the placeholder is what changes. this way i can have my menu loaded as a control. However, now that i am getting into Forms authentication and such i see that it will take some trickery to implement this the way i have the site now. Since default.aspx is always the loaded page so it would be difficult to restrict access to other .ascx files i make. At least from what i understand about authentication sofar it would be. So the question is, is my method of having one page always load and the content loaded into a placeholder the way to go, or is there a better way to have a site design that would be able to use a menu on each page without having to put code in on each page to use that menu?
  10. exactly what i needed. thanks.
  11. i am creating a web site with asp.net/c#. how, when someone visits my site, do i find out what IP address they are visiting with?
  12. i am trying to create a LinkButton in a web page using VisualStudio.net with c#. how do i write an event handler for the linkbutton? something along the lines of LinkButton += new System.Web.UI.WebControls.CommandEventHandler(OnLinkClick); i of course want to be able to click on the link button to load a new page, how do i do this? thanks.
×
×
  • Create New...