Jump to content
Xtreme .Net Talk

fguihen

Avatar/Signature
  • Posts

    251
  • Joined

  • Last visited

Everything posted by fguihen

  1. from what i understand, that should bring me to the db4 file in the folder fin which the asp page is in on the server. im prob wrong though as i really dont understand mappath() . il mess with that. thanks
  2. my database is in the same folder as my asp page, so i use the mapPath function to try to connect to it using the line: conn1 = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath(".")+ "/db4.mdb"); i then have the the two lines following it: sql = new System.Data.OleDb.OleDbCommand ("select username,password from users"); this.conn1.Open(); this.dataReader = new OleDbDataReader(); dataReader = sql.ExecuteReader(); it all seems correct to me but i keep getting this error, which i can make no sense of: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized. at System.Data.OleDb.OleDbCommand.ValidateConnectionAndTransaction(String method, Int32& localState) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at Upload.Logon.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\upload\logon.aspx.cs:line 72 any ideas at all.its been wrecking my head for two hours now.
  3. thank you. i feel so stupid
  4. ok ive been through loads of pages showing me how to create a session variable, but when i try it i get an error. heres what i do: i cerate a string called departent. this is initialised with text from a text box i then use the line "Session("department") = Department.text; i get the error "(77): 'System.Web.UI.Page.Session' denotes a 'property' where a 'method' was expected" i have tried loads of other things like Session("SomeName") = Department.text etc etc is there a namespace i need or do i have to create a session object(thought one was automatically created on the server)
  5. afraid im just using my own little crappy if statment to validate users
  6. after i have validated that a user is authorised to use my site, how do i load up the next page, (actually a web forum), after a login page, in c# code
  7. sorry , i phrased that very wrongly. what i mean is , under the default web site folder , i can see pagetopage data, but it is not a folder. its just looks like a little box thats open. i have a new error now though when i try to load http://localhost/pagetopagedata/webform1.aspx: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'PageToPageData.Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="PageToPageData.Global" %> Source File: C:\Inetpub\wwwroot\PageToPageData\global.asax Line: 1 sorry to keep bothering yall
  8. theres no folder called default web site, in the inetpub folder, or in the iis configuration manager.
  9. i downloaded that zip, unzipped it, placed the folder in my wwwroot folder, but when i try to access webform1.aspx or webform2.aspx, i get this error: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Source Error: Line 23: "Forms", "Passport" and "None" Line 24: --> Line 25: <authentication mode="Windows" /> Line 26: Line 27: Source File: c:\inetpub\wwwroot\pagetopagedata\web.config Line: 25 any ideas??
  10. in a c sharp web app, how do i create a session variable, and/or how do i pass values between two pages ( eg pass users dept from login page to teh next page). which is better, to use session variables or to pass values between pages?( there is no script tags in my aspx page, it just calls a c# class)
  11. i want to call an access query in my c sharp / asp application. how do i do this?
  12. when a user logs into my site, i want to use the department they choose, to allow them access to a folder on the server. im told i need a global variable to do this. how do i create and use a global variable ( Im using c sharp). thanks all
  13. well, the way i want it to work is this: there are 3 different departments in my building. they all have a little page on the web site. rather than letting them update it by messing with the html and wrecking it i want to create an asp page where they log on, they can then add /delete/change the content of their page. the file upload is for them to upload pictures. i want to be able to load the pics into a different directory , depending on who is logged on ( eg. sales will have their pics stored in a folder called salesPics, purchaces in purchacesPics etc) i want to know how do i select a particular directory on the server to upload the images into? hope this is a decent explination
  14. imusing this line to save files from my pc to a server: myFile.PostedFile.SaveAs(Server.MapPath("./.")+strFilePath); how would i change this to allow me to save the file into a spcified location on the server?
  15. i have IIS ver 5 on my pc, along with visual studio dot net 2003. when i go to create a c# asp application, i am told there is an incorrect server running on the pc.i thought ISS ver 5 would work.whats wrong??
  16. as you all now have realised, im new to this asp.net. if i create a class in c#, which is to be used behind an aspx page, do i have to store the .cs file in the same folder as the aspx file or what. i think this is a really silly question and im sorry for wasting your time
  17. thank you very much.i will prob end up using this method on code project, but first , i would kinda like to go the long way around and use c# , and rather than simply use a method like UploadFile(lodation, Destination) , or whateverit is, i would like attempt to create this method myself in c#, for educational purposes. anyone got any info on how , step by step, a file would be uploaded from my pc to a server?or how i would go about this in c#
  18. hi. mentioned this prob a yesterday, in relation to old asp , but i think from looking around i would be better to do it in asp.net. now, the task is to allow people to update their little part of my site themselves, through asp. i want them to be able to upload jpeg's , but limit the size of the images they can add. the files will be uploaded to the server, an path leading to them will be stored in a DB , and this will be called to display them to a web page. can anyone explain the steps to uploading a file from a pc , to a server, in .net ( il be using c sharp). thanks all
  19. if i create an asp page with asp.net and c#script, can i run it on a regular IIS server, or do i have to install the dot net framework or anything else?
  20. hi all. i know this is a dot net site, but i find this site great so id say some of you can help me. i am using regular asp ( not dot net). i have a site tith info from many different departments in my building. the problem is when a change has to be made to the info, i have to do it manually. i want to create an asp page that allows people to do this themselves( submit data into a db ). i need for them to be able to log on, and i think i can solve that one myself. the problem is uploading pics. i want them to be able to upload a max of 3 pics, i want to be able to limit the size of the pics. how can i write a script , in vb script, that will check the files are within the size limit, and ftp them to the server? thanks for any help recieved . if anyone can recommend a good site for old asp + vbscript id be greatful
  21. thats all great to get thoose, but where did you get them from?if i need different ones in future, where do i look ?
  22. i am writing a program that will allow me to shut down my pc after a specified length of time ( as i listen to my music whale i am falling asleep and want the pc to turn off automatically) . i know there are many ways to do this out there but i wana make my own. im going to use the "ExitWindowsEx function from the Win32 api. there are various constants such as EWX_LOGOFF, EWX_POWEROFF etc that i need to use but i dont know what values are needed in them. can anyone tell me where to get the data contained in theese constants, or how to include a headder file of c++ in c#. hope you all know what i mean. thanks
  23. well, i done that exactly before this, but im not trying to convince you or anyone. it worked for me , but you can think it doesnt work if you want
  24. well, hed have to create a file stream, and read in the file into a string. he wouldnt need to know what is in the string , he would only specify the part of the string he wanted to remove, and the string he wanted to put in its place. your way is prob better but theres a lot of stuff going on,and i like to keep things simple. both ways would work though
  25. theres a method of the string class, replace("word to be replaced", "word to put in place of old one"). i think thats the format of it. just type in the line you dont want as what you want replaced, and make a blank string to replace it. not sure but i think this will work, as i have used i tn c#
×
×
  • Create New...