f1 fan 16 Posting Whiz in Training

Please read the forum guidelines at this link
http://www.daniweb.com/techtalkforums/announcement61-2.html

I gave help and advice without doing the coding for you as i expected you to be able to at least look up what i had mentioned. I had on a few occassions written the code for you also. I cannot accurately gauge your level of understanding so all you had to do was ask for amplification of something instead of complaining about my answers. I have been programming for 27years and am still learning. So i dont think of myself as fantastic. I try and help those who help themselves but either you have been assigned a project that is way beyond what you have been taught - in which case i would raise it with your instructor, or you have chosen a project which is way beyond what you have been taught. In which case i would have to ask why.

But as you have requested, i have removed myself from this thread and wont answer any more of your questions. Good luck with your project

f1 fan 16 Posting Whiz in Training

i am not clear on your request sorry :) are you asking how you can temporarily disable the back key on the browser? or disable the backspace key as a browser back key?

f1 fan 16 Posting Whiz in Training

1. This is a TECHNICAL forum so excuse me for speaking in non laymans terms
2. From all of your posts it is obvious that you have no idea about programming/websites/security etc. Whilst i appreciate we all have to start somewhere it is also becoming apparant that this site you are building is destined for a real life commercial website which scares me. To think that you are messing with other peoples money, credit card information and such is frightening. Your site will be hacked in under 30 seconds and peoples information could possibly be at risk. I sincerely hope that you have a vast amount of liability insurance as you will need it.

f1 fan 16 Posting Whiz in Training

the request object has all the information you need about the client. The only problem you would have with ip addresses is if you are behind ISA2000 (not the 2004) or they are behind some proxy.

How will it make your site secure? Are you going to log all ips against a person? I have over 50 class A ip addresses and i also have some dynamic class c ones.. are you going to log all of them? how? why? What does it achieve? There are times when you do need to track an ip but it is for auditing usually and sometimes it is necessary when only allowing one login at a time (but then you get into the realms of having to know when i crashed or timed out and now have a new ip).

Tell us what you are trying to achieve and we will give you the correct solution instead :) as i dont think this will suit your purpose

f1 fan 16 Posting Whiz in Training

i doubt it is legal. You would almost certainly violate the license agreement

f1 fan 16 Posting Whiz in Training

ahhhhhhhhhhhh now i am with you
welcome to the world of no browser conforms to the W3C standards! Opera and firefox are doing it correctly. IE is doing it wrong but as you are using vs 2005 you design in IE so dont realize. 1 piece of advice - always use two browsers when you are developing. I use Firefox as the main browser and check on IE but thats a personal choice.

Tables are your problem and setting the heights. I am going to assume you are using XHTML as the markup? This is the default in vs2005 and you should always use it.

Use styles or style sheets then it will work. Make sure things are correct. Tables were incorrectly used in the past for layouts. They are for data. DIVs SPANs etc are for layout coupled with CSS.

To get yours you need your html to look like this

<body>
<form>
    <div id="container">
        <div id="header"></div>
        <div id="contents">
           <div id="menu"></div>
           <div id="contentholder"><asp:contentplaceholder .... /></div>
       </div>
       <div id = "footer"></div>
    </div>
</form>
</body

And your css file should be like this

html, body, form
{
height:100%;
}
form
{
text-align:center;
}
#content
{
margin:0px auto;
text-align:left;
width:???px
height:auto;
}
#header
{
<put styles in here you want such as backcolor etc>
}
#contents
{
<put styles in here you want such as backcolor etc>
} etc for the others 
#footer
{
<put styles in here you want such as backcolor etc>
}

That should do …

f1 fan 16 Posting Whiz in Training

Visual Studio .NET 2003 trial versions had an absolute expiration date too. I think it want activating. But to be honest i would get trial version of VS2005 express edition. They are currently free for a short time from microsoft site, but you have to download them.

f1 fan 16 Posting Whiz in Training

Can i also point out some problems/areas of improvement?
1. dont post your real connection string anywhere in public and especially not in forums :)
2. When you do implement the command execute only the first seat will be saved as you didnt loop through the others
3. Why do you iterate through all the selected items in the list, comma delimit them then go through that list pulling them out one by one again?
4. Please avoid writing sql queries in code. Use stored procedures. I dont know if you plan on using this in the real world or if it is just a project but if you have a webpage with sql code behind it from textboxes etc it takes me less than 10 seconds to get into your database and do whatever i want - read, write, delete and i could probably get into every database on the server from there. Its called SQL injection and it is #1 on hackers things to try on a website. Even if it is just a project, try and get into the habit of writing stored procs so you wont accidently leave sql code in your webpage on a live site one day.

f1 fan 16 Posting Whiz in Training

There a numerous ways to achieve it. There is no such thing as a "Dock" property in webpages, however there is positioning through style sheets and such.

First of all you need to grasp the concept of a web page as opposed to a windows form from a developers point of view (and this is crucial to web development that so many forget). In a windows form you have 100% control. You created the form, you know everything about it and control it all. With webpages you dont. You write (directly or via asp/asp.net etc) markup language. You have no idea how that will be viewed (if at all - remember bots read your html too, thats how google gets its search information). So you have to cater for the fact that there are many different browsers (IE, FireFox, Netscape, Safari, Opera etc) which all (unfortunately behave differently and none conform to W3C standards) with different modes. The users all have different screen sizes and resolutions and may or may not have their windows maximised.

So you only write the markup and their browser or whatever is the "form" (known as the viewport) to display this to the user. So you have little idea about it. Including size.

Ok now the lecture is over lol :D But it was important to grasp the difference.

You can position anything anywhere using stylesheets. You can position absolutely, relatively, fix permanently (even when scrolls) and in % …

f1 fan 16 Posting Whiz in Training

I will change it to vb but bear with me as my vb is rusty to say the least.

imports System.Data;

//in some function
Dim conn As System.Data.Odbc.OdbcConnection 
Dim dt As DataTable
Dim da As System.Data.Odbc.OdbcDataAdapter;
Dim connectionString As string
Dim importFolder As string
Dim fileName As string

importFolder = "c:\importfile" //or pass it in -this is the folder in which the csv file is in

fileName = "csvimport.csv" //or pass it in -this is the csv file to be imported

connectionString= "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + importFolder + ";"
conn = new Odbc.OdbcConnection(connectionString)

//we only pass it the folder.  The csv file import is in the query which follows

da = new System.data.Odbc.OdbcDataAdapter("select * from [" + strFileName + "]", conn);
da.Fill(dt);

//Your table is filled and uses the first row of the csv file as the column headings.
f1 fan 16 Posting Whiz in Training

c# code

using System.Data;

//in some function
System.Data.Odbc.OdbcConnection conn;
DataTable dt;
System.Data.Odbc.OdbcDataAdapter da;
string connectionString;
string importFolder;
string fileName;

importFolder = @"c:\importfile" //or pass it in -this is the folder in which the csv file is in

fileName = "csvimport.csv" //or pass it in -this is the csv file to be imported

connectionString= @"Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + importFolder + ";";
conn = new Odbc.OdbcConnection(connectionString)

//we only pass it the folder.  The csv file import is in the query which follows

da = new System.data.Odbc.OdbcDataAdapter("select * from [" + strFileName + "]", conn);
da.Fill(dt);

//Your table is filled and uses the first row of the csv file as the column headings.

Hope it helps :)

f1 fan 16 Posting Whiz in Training

oh, it uses its own cookies. Set the expiration etc in the web config. Both sliding and absolute. They have it all built in. If you need the config stuff let me know :)

f1 fan 16 Posting Whiz in Training

It is because everytime you reload all the controls everytime - every postback.
Remember the pageload etc is fired everytime you do something and is fired before the button click event, or selected change etc. so be very careful where you want things to run (ie choose your events - page load, init, loadviewstate etc - wisely) and also decide whether you want it to run every time or just on postback or not (use the Request.IsPostBack to check for this). You can always move parts or all of your function out of the event (i would not code in events either, just call them from events - thats good programming practice for web and windows apps) so you have full control.
I am not 100% sure what you want to do when so cant redo your code for you, but can give you pointers. Use the IsPostback and check the events you are using and whether it is the right one. 90% of unexpected results in apps are usually because the wrong event is chosen. Events are so similar so you have to understand them all to choose the right one (a simple example is the mousedown, mouseup and mouseclick - putting the same code in different events can have different results).

f1 fan 16 Posting Whiz in Training

first try

strLoginName = Server.HTMLEncode(Request.Cookies["mydomain-LoginName"].Value);

Are you not getting anything? Does your browser not accept cookies? Or only from certain paths? If it doesnt you wont get an error. Test with Request.QueryString["AcceptsCookies"] to find out.

f1 fan 16 Posting Whiz in Training

Why not use the checkbox list control? This automatically places them in an array (which is your other option with normal checkboxes) so you can loop through them

f1 fan 16 Posting Whiz in Training

Paris Hilton acts? I need to revisit the dictionary and look up the definition of acting lmao :D

f1 fan 16 Posting Whiz in Training

make it a static function in a class (say Utilities) then in your click event in code behind just call Utilities.RandomPW(7). But you need to return the password you generated.

I have created a random password generator function in asp.net (vb.net)

No you copied it without understanding it again. There is no way that you could have thought up that code and coded it and then not know how to call a function.

f1 fan 16 Posting Whiz in Training

I already gave you the code to get the seat numbers and put them into a table. Why didnt you just bind this table to the listbox? Then your table is ready to be saved in the database.

f1 fan 16 Posting Whiz in Training

There is a big difference between asking a specific question (as in your other post about the external program) and a general "someone write my program for me" question.
People will always help someone out who is stuck but at least show you have tried some things first.
You cannot tell me that if you put "login code c#" in google you wont get at least 100 hits with some examples of code in there. So he didnt even bother to do that, but asked someone to write it for him and send it.

f1 fan 16 Posting Whiz in Training

so you are saying the other program is not yours? But you want to use it in yours? Just one word - LICENSE! No programmer in their right mind is going to grant you a royality free license to do that. You either bought the program yourself so if you keep redistributing it then you are "stealing" from the original developer or you downloaded it which possibly was illegal depending on the source, or the program was freely available but for your use only. If someone releases a program with no source code it means they dont want you to know how they did it. There are ways of getting the source, but i am not going to give them away in here.
In a nutshell you are breaking licensing and probably copyright laws and that (in any country) is a serious offence.
I make my living in IT and i would not hesitate for one second to bring the full force of the law down on anyone profiting from my work. I have staff to pay who have families to feed and you are stealing from them! On saying that, i developed a licensing and anticopying mechanism for just such occassions which works with any .net application with just 3 lines of code.

f1 fan 16 Posting Whiz in Training

oops there is supposed to be a space between Integrated and Security.... Integrated Security=SSPI

f1 fan 16 Posting Whiz in Training

the problem is you are using the sa name and password but have set it to windows authentication only not mixed mode. take out the userid and the password and replace with IntegratedSecurity=SSPI that should work, i would also have an Initial Catalog=<databasename> in there too for your app

f1 fan 16 Posting Whiz in Training

there is a way of doing this. I use it extensively for tracking as you mentioned. You need to use an http module. Change your image url in the webpage to http://site.com/notanimage.jpg then in your http module you check for the name, do whatever logging you need and then replace the request with the original url (http://site.com/image.jpg).

If you need code let me know and i will post some (have to change some of mine not to give commercial secrets away :D) IT is only a few lines :)

f1 fan 16 Posting Whiz in Training

But the question he asked was so open ended. Is it windows or web or web services login? VS2002, 2003, 2005? What datasource? XML? SQL Server 2000? SQL Server 2005? Notepad? Webconfig? Excel? Access? etc. Login for the whole app or part of it?

So thats why he was "jumped on". for not reading the guidelines. We help those who help themselves. Too many people want someone to do all their work, project or homework for them. I saw one post in here where a woman typed in all 100 questions of her homework. It took her longer to type them to be answered by us than it would have taken her to look up the answers!

f1 fan 16 Posting Whiz in Training

C# is less forgiving than VB in terms of lazy programming. In C# if a method signature has a parameter designated as 'ref' or 'out' then when you call that method (as in you call the winsock.GetData then you have to declare your parameter as 'ref' or 'out' also. This is telling everyone you understand what you are doing (allegedly hahaha) and know what params are being passed and what you expect out. Also any method you call has to have () after it if there are no params whereas vb adds them for you i think (or doesnt insist on it). Like i said, VB allows lazy programming which in turn allows for some unexpected results. For instance, you dont have to have Option Explicit and Options Strict on (I think strict is off by default which is bad but i think you can change it on your ide options). C# doesnt even give you those options - and quite right too.

f1 fan 16 Posting Whiz in Training

Can i ask why? Is the new program an enhancement of the old? Or is the new program using some features of the old? Either way i would make the old program a class library and then it (or parts of it) can be used by many other programs.
Dont be fooled by the fact that you have a UI in the program so it cant be a class library. Hardly any of my .exe files have any UI in them, they are mainly to hold the main controller (i strongly advise looking up the MVC pattern) which then calls various UI's and other libraries depending on the application, the client, the user etc. So much more flexible for now and the future.

f1 fan 16 Posting Whiz in Training

welcome and enjoy

f1 fan 16 Posting Whiz in Training

oh ok i thought you were trying to get the MAC and other things too.

your dns is in the form xxx.xxx.xxx.xxx

so there is a clue. it is DELIMITED by the . (period)

so instead of your textbox1.text = h.AddressList.GetValue(0).ToString

dim ipfull as string = h.AddressList.GetValue(0).ToString

dim ipsplit as string[] = ipfull.split(".".tochararray[])

you now have an array in ipsplit.
textbox1.text = ipsplit[0]
textbox2.text = ipsplit[1]
textbox3.text = ipsplit[2]
textbox4.text = ipsplit[3]
all done

f1 fan 16 Posting Whiz in Training

welcome.
That is a huge project to undertake for a beginner. There are so many new concepts for you to learn. No one will post the code here as it would take a long time to code it. You have a lot of design decisions to make first - will it be purely web browser based, will it use web services or .net remoting? how will it be hosted on the server? IIS, windows service or custom hosting? What database will you use. And thats before we even get into designing the program itself.
Put that project on a list of things to do in the future as you really wont understand if i talk about .net remoting and sinks, proxies etc or if i talk about webservices and wsdl and soap.
Get yourself a good beginners book or better go through the web and look at some apps there. the msdn library is always a good place to start. They usually have 101 applications in VB (or C#) which are useful both as tools and as an understanding of how to do most things. They start off simple and go through to complex things and i am sure webservices, web pages and remoting will be covered there as well as gdi+ which you will need to draw your games to the screen.
Good luck :)

f1 fan 16 Posting Whiz in Training

but you have changed the requirements to get round a problem in your code rather than changing your code to meet the requirements - bad practice. I strongly suggest that no system would allow usernames to be null but you have just allowed that. you are correct in doing a rowcount (which you were not doing before). But that should be all you need. Remove the Dsaccess1.dbtaccess.UsernameColumn.allowNull = True and it should still work and you have not changed the requirements to get round a code problem but changed a code problem and still met the requirements :) Good programming practice!

f1 fan 16 Posting Whiz in Training

use System.Management classes to do it. Writing WMI queries. Have a look at it and if you are stuck let me know and i will give you some code.

f1 fan 16 Posting Whiz in Training

sorry... got me on a bad day yesterday
i would look up the string split on msdn and also the stringsplitoptions (if you have .net2 - vs2005) and enumerators.
but to get you going just leave out the stringsplitoptions for now so your code reads string[] field = moje.ToString().Split(("/").ToCharArray());

f1 fan 16 Posting Whiz in Training

Only allow people in the areas you specifically want them in so structure your site with subdirections

Should say structure your site with subdirectories. i should pay attention when i type.

f1 fan 16 Posting Whiz in Training

the very first and most important step is good programming. I cant stress it enough. Test for every eventuality. Too many people think error handling is a try catch block around everything. Secondly implement some login mechanism. Only allow people in the areas you specifically want them in so structure your site with subdirections. Validate every input at least 2x. Once on client side as best as you can (using the validator controls) and once on the server side (and if you can - in the database before a save). Use roles where needed. NEVER use querys in code ALWAYS use stored procedures. Disable the SA login in SQL Server and create a new one if you need to have a non windows one. Do not give windows accounts db permissions (except to DBAs and developers) always use application accounts. Encrypt passwords for connection strings and encrypt connection strings. Hash user passwords. Use strong passwords (a strong password for those who do not know is made up of upper and lower case letters, numbers and symbols). For those who say a strong password is too hard to remember try this. Make up two small words that are not associated (eg car knife) now substitute some symbols and numbers in there (@ or 4 for an A and ! or 1 for an I, and 3 for an E, $ or 5 for an S) and uppercase the first letter of each word. So your password is now C@rKn1f3 Thats a …

f1 fan 16 Posting Whiz in Training

I use it a lot :D

f1 fan 16 Posting Whiz in Training

that is because you copied from something before understanding what you were doing :D StringSplitOptions is optional for a start and is new in .net2 so unless you are using that leave it out. It is an enumerator so you cant just say StringSplitOptions you have to choose one of the enumerations you want

f1 fan 16 Posting Whiz in Training

if i get time i will have a look more closely :)
Anyone know how to get 26hrs out of a day yet?

f1 fan 16 Posting Whiz in Training

i would go with either java or c# as they are similar syntax so you can learn the othe pretty quick once your grasp the first.
At the risk of being hounded out of the forum and possibly the planet i would not recommend the vb route. prior to .net vb had a bad rep and unfortunately when vb.net came out some old vb programmers were too lazy to learn true oo techniques and so whined to microsoft to put some extra libraries in there (those of you who remember the beta1 of vs2002 will know what i mean - they werent in there). Those libraries can lead to bad habits and are not available in other languages. (why did they need to have string left put back in? was substring too hard to spell???) The rumor was that C#2 was supposed to widen the divide between vb and c# again but with all the problems they had getting it out in time a lot of things were put off to c#3. So i would stick with java or c#.
Well i will brace myself for the attack by the VB die-hards now :)

f1 fan 16 Posting Whiz in Training

cookies

f1 fan 16 Posting Whiz in Training

ps if you are worried about the eol chars being one or two you can test for them in your derived class and make adjustments accordingly.

f1 fan 16 Posting Whiz in Training

overload means you have an extra method of the same name but the signature differs by parameter type

so you can have a method public void mymethod()
and overload it with public void mymethod(string param1)
and more ... public void mymethod(int param1)

but it is only by param type not param name so you cant have
public void mymethod(string param2) as another overload. However you can overload as follows
public void mymethod(int param1, string param2)
public void mymethod(string param3, int param4) as the signature has changed

return types do not overload so changing that wont work. The advantage of overloading is the compiler knows which method to call by the signature without you worrying about it.
you can also put common tasks in one eg
public void mymethod()
{
mymethod(true)
}
public void mymethod(bool someflag)
{
common code stuff here ...
}

overriding is different. If you have a base class with
public void mymethod()

then you can have your derived class override it
public override void mymethod()
{
}
you method gets called. Now you might want the base mymethod so you can call that
at anytime in your derived mymethod. The only time you cant override is if the base is marked sealed
You can even override and overload (even if the base has no overloads)

in your case i would …

f1 fan 16 Posting Whiz in Training

sorry... that will teach me to explain something to someone and try to answer this at the same time (i was explaining shadowing in vb vs new in C# to them so had it on the brain). I meant to say i would override not overload the readline, adding your bytecount there.

f1 fan 16 Posting Whiz in Training

I havent had time to go over this in detail, just a quick scan, but you didnt need to copy the code from streamreader did you?
You could have implemented a shadow readline and added your own code, or you could overload readline with a parameter and have your code there whilst maintaining the other readline.
Personally i would have gone for the shadow method so you keep the same signature. Then in there you call the base readline then do your count and then return the information the base gave you

f1 fan 16 Posting Whiz in Training

im not doing your homework for you as i said... and you dont seem to want to help yourself.
To store information in the session you create a key for it and assign your information you want to store in there to it.

Session("theseats") = the_collection_you_store_your_seats_in

you have to get your collection out of the session to add your seats to it and then store it back in the session so you need

if (session("theseats") != null) then
the_collection_you_store_your_seats_in = Ctype(session("theseats"), thecollectiontype)
end if

then when you want to store in the database just store the collection

f1 fan 16 Posting Whiz in Training

Its part of my job - to find security holes in web sites and i think i can get into about 25% of so called "restricted access" websites within 30 seconds by SQL injections. Without knowing anything other than this post i would put money on the fact you are using the SA login, i would also put some good money on the fact that at least 25% of people reading this post are using the default SA password. I would also put money on the fact that 75% of "internal" applications (ie those that are within a lan/subnet for internal use only and not anywhere near the web) use windows logins for authentication and database access (then they wonder why their data is corrupted because all the users are linking access and excel spreadsheets to the data and changing it bypassing the integrity checks.
And just as some casual information... the most popular administrator password is.......... wait for it.... CONTROL

f1 fan 16 Posting Whiz in Training

You need the mouseclick event of the textbox. Then from the mouseevent args you can find out which button was pressed( e.button), left - right - or middle and call the method you want from there. You can also find the number of detents the wheel was rotated if it helps your scrolling (e.delta).

f1 fan 16 Posting Whiz in Training

Dont quote me but i think ie is a little less strict on interpretation of some css features than others. you might try background-image and see if it works. You may even have to code both, one for ie and one for firefox (seems like half my css is coding for different browsers! I even have an iefix.css file on half my sites!

f1 fan 16 Posting Whiz in Training

I recently posted a tutorial under the .NET tutorial section on how to email a form in a few easy lines.

http://www.daniweb.com/tutorials/tutorial38004.html

f1 fan 16 Posting Whiz in Training

setting a form as an mdi container is one property on the form (IsMDIContainer). After that to set forms as mdi children when you instantiate a new form just set its MDIParent property to the parent instance. and all done.

The problem with blindly copying code is that you dont know what it is doing and therefore how to debug. By all means copy code to learn but do it in a seperate project and try to reproduce it so you understand it, and then try to expand/edit it so you fully understand it. Dont be fooled by the "i dont have time to do all that" thoughts as you are fast finding out that debugging takes a lot longer than coding and is 1000 times harder when you dont have a clue what it going on.
I would say a good programmer needs to be equally good at both coding and debugging (or possibly better at debugging) as i have yet to see someone code a real world program bug free on the first cut.

f1 fan 16 Posting Whiz in Training

I think he is on about the web admin page that comes with VS2005. Which is just a simple interface to both the webconfig and any providers.

But i am not sure of what is missing or the rest of the web config? some light would help