hericles 289 Master Poster Featured Poster

Have you actually debugged and checked the output of the reader? It is correctly pulling the information from the database?If it it and UserType then contains either A, S or P you should get redirected...

hericles 289 Master Poster Featured Poster

Now I'm confused. If the user type in the data base is stored as a number why are you testing to see if it equal to A, S or P? What is the data type of the userType column in the database? If the reader is holding numbers and you are checking for letters your MsgBox should fire everytime because cases A, S and P will never work. Is that was is happening?

hericles 289 Master Poster Featured Poster

Have you got your folder structure the same on your host as on your local machine?

lhsunshine commented: tq very much.... i have put the style sheet in wrong folder.... +0
hericles 289 Master Poster Featured Poster

You have already stored the UserType from the first read of the dataReader so the second attempt is unnecessary. Simply use a switch statement to check the value held in UserType and redirect as need be.

switch(UserType) {
    case "S":
        redirect...
    case "A":
        redirect...
    case "P":
        redirect...
}
hericles 289 Master Poster Featured Poster

Data.CommandBehavior.CloseConnection returns an enumeration (the number 6 from what I just looked up on MSDN). This means you are in effect calling

Dim result As Data.SqlClient.SqlDataReader = dr(6)

Which probably doesn't exist as your dr has 6 items or less. As you already have the dataReader set up I'm not even sure why you are creating another dataReader equal to the existing one just to see if it has rows.

hericles 289 Master Poster Featured Poster

I'm not sure what the actual limit is (although I think I once read it was a year) but you wouldn't want to have it more than an hour or two surely. If you set it to a very long time you're going to be wasting a lot of server memory with session variables that aren't even being used anymore.

hericles 289 Master Poster Featured Poster

Try using the getString() method of the reader with the column number. E.g.

logID = dr.getString(0)
PassW = dr.getString(1)
hericles 289 Master Poster Featured Poster

You can see your mistake in the error message. Pay close attention to the quotes and you'll see you aren't placing them in the correct positions.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tests,'20120508,'5.5,'20120508)' at line 1

You have (Test, '20120508, '5.5, '20120508). You missed the closing quote in three places.

hericles 289 Master Poster Featured Poster

The data reader is a forward only way of moving through the data extracted. You can use other types if you want to be able to arbitrarily select a position. The dataTable can be referenced by iterating through the rows so moving back forward is easy.

hericles 289 Master Poster Featured Poster

You can store name/value pairs in session state very easily. Once you have logged in a user you can set the ssions variable like this:
Session["loggedIn"] = "true";

You can then later alter the session variable or check it for logged in status. In your global.asx file you can specify any session variables you are going to use by setting them up in the session_start section.

I hope that helps.

hericles 289 Master Poster Featured Poster

If I understand you correctly you want to be able to display a PDF on screen in a browser and have a user enter comments. The first part is easy, browsers display PDFs naturally so you just link to the PDF. To have the PDF and the ratings/comments section on screen at the same time link the PDF to an iFrame and have the comments below it (or above it). Then you can have both things on the one page and easily viewed by the user.

rogerg commented: thx, I'll give it a try +0
hericles 289 Master Poster Featured Poster

We can't help you with these questions without knowing depth what you are you are trying to do. You need to make the decision based on your requirements and what information you want to save and use. If you want to be able to link products to certain categories then yes, you will need a data store that allows you to do that.

hericles 289 Master Poster Featured Poster

Hi,
Your question isn't very well worded. But I'm guessing you are asking what database tables should make up your database. That depends entirely on what data you are trying to capture. Generally you would give the table a name that descriptively explains what the table stores whilst keeping it short. So if you had an application that recorded customers and their orders you would have tables for Customers, Products, Orders and at least one more for recording the individual items that make up an order.
Does that make sense?

hericles 289 Master Poster Featured Poster

800 x 600 is limiting yourself these days, most users have a larger screen (at least 1024 x 768). You can actually check the percentages of users that use certain screen resolutions online. Currently 1% of users use 800x600, 13% use 1024x768 and the rest are higher (source: w3school)
The appropriate number of categories is going to depend on the products you want to list and how easy it would be for the user to locate the categories they want. For example, if you sell everything under the sun one category for Books is probably fine, if all you sell is books then you would need to break that down.

hericles 289 Master Poster Featured Poster

Well, using HTML for a web page is a bit of a no brainer, the database you use isn't very important either as long as you understand the differences between them.
ASP.net to build your server code is fine, no better or worse than anything else if you have no restrictions on hardware platforms.
So, in short, can you build your project from what you have selected, yes.

hericles 289 Master Poster Featured Poster

How are you defining the footer area in your CSS? And the div that holds the contents - is the height fixed at a set height or auto?

hericles 289 Master Poster Featured Poster

But you are doing server side processing, thats the problem you are having. So you won't be triggering a round trip just to clear the form because you can just add that to whatever else you are doing server side. No extra trip required.

hericles 289 Master Poster Featured Poster

If you haven't got a file called ie.css in your website you can take it out without any problems. It looks like you have a problem with the footer part of the page in IE

hericles 289 Master Poster Featured Poster

What year are you in and what is your skill level? They will be limiting factors in what type of project would be acceptable for you to do.
Are there topics you should include that your instructor has mentioned?

hericles 289 Master Poster Featured Poster

Client side actions happen first because they occur in the browser and don't require the post back. Why don't you simply remove the part of the script that clears the form?

hericles 289 Master Poster Featured Poster

You need to make sure neither the selected start or end date of tenancy is the bookings table to ensure the apartment is free for that period. Assuming you have two inputs for the start and end dates this should work:

SELECT apartment_id FROM apartments AS a JOIN bookings AS b WHERE (startDate < b.booking_start_date AND endDate < b.booking_end_date) OR (startDate > booking_start_date AND endDate > b.booking_end_date)

I haven't tested this and it could be improved (it is basic in its business logic). For example, the startDate can be < (booking_start_date - 1) to ensure that it is available for at least 1 night.

hericles 289 Master Poster Featured Poster

It is pretty easy using HTML5. Check out the source code at this link:
http://html5demos.com/geo

Remember that it requires the user allowing access (which is a good thing).

If you want to do it in code this example shows how to use a PHP library supplied by ipinfodb.com to back trace an IP address and get the lat and long coordinates
http://developergeeks.com/article/44/how-to-get-geolocation-from-ip-address-in-asp-net

hericles 289 Master Poster Featured Poster

Part of any database connection string is the location of the database. If you are using an online or remote database you simply specify the IP address and port number instead of the server name. E.g.

Data Source=190.123.36.12:4333;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
hericles 289 Master Poster Featured Poster

This part is incorrect

ttam.class != ttam1.class!=ttpm.classpm!=ttpm1.classpm

You can't string them together like that. You need to separate them out as separate claues and use AND or OR to build up the logical expression.

ttam.class!=ttam1.class AND ttam1.class != ttpm.classpm AND ttpm.classpm != ttpm1.classpm
hericles 289 Master Poster Featured Poster

When you say it goes off the page do you mean you have to scroll to see it all? That just means you have more content than will fit on one page...

hericles 289 Master Poster Featured Poster

Is the content inside the container div taller than the screen is high?
If so then it will be too much for the container to handle and will overflow. Try setting the container div height to auto and see what happens.

hericles 289 Master Poster Featured Poster

Have you checked how the date is formatted in the table? MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM: SS' format so values such as 03/14/2012 may not exist in the table.

hericles 289 Master Poster Featured Poster

That is because you are firing the code in the SelectedIndexChanged event of the first combo box and included the selectedIndex of the second combo box before it has been changed.

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Dim r As DataRowView = ComboBox1.SelectedItem  // has been set (fired this code section)
        Dim rr As DataRowView = ComboBox2.SelectedItem // hasn't been set yet, is still default value
        If Not IsNothing(r) Then
            ComboBox3.DataSource = GetTable("select CRID , CRname From ClassRoom Where YearID = " &     r("YearID")&" AND DepID ="&rr(DepID))
        End If
    End Sub

You need to address the error in the logic there. You can either make the second combo populate when the first item is selected (forcing the user to select them in order) and then fire the code in the second combo boxes selectedIndexChanged event or include a button which uses the set values of the two combo boxes.
Trying to assume that both combo boxes have been selected is a mistake.

hericles 289 Master Poster Featured Poster

You might want to start with something like this:
http://www.htmlgoodies.com/beyond/css/article.php/3642151/CSS-Layouts-Without-Tables.htm

But if you google HTML layouts you'll find what you need (avoid anything that teaches you table based layout!)

hericles 289 Master Poster Featured Poster

Do you know HTML and CSS? If you are provided with an image of how the page should look you need to create a template that mimics that look by using HTML and CSS to place the required elements in the correct places.
The first step would be to identify the block elements that make up the page - header with banner, where the navigation is, number of columns, etc - and place them correctly and then start adding the colors, images, text, etc.

hericles 289 Master Poster Featured Poster

TRUNCATE persons; will clear out the table and reset the auto_increment primary key to zero.

hericles 289 Master Poster Featured Poster

Where is getNumber being called from? I imagine it would be part of the main method so the rest of the code has a number to work with but I can't see where you are calling it from.

hericles 289 Master Poster Featured Poster

How long are the credit card numbers you are using? In your getPrefix method you are dividing the credit card number by 100000000000000 (16 digits) so credit card numbers with 15 or less digits never pass your check of is p > 4.
The number I tested was 15 digits and p = 0.37144.

hericles 289 Master Poster Featured Poster

You have sor in quotes for a start. Is that a typo or part of your code because it, at the very least, should be:

url = sor + "resources/stdInfo/authenticate/" + tx.Text + "/" + passwordBox1.Password+ "/1/570322308ce1121cba1b93f5acc9ebd4733ef2bca90ef942a2cfa224f0aa08dc/1";

NPDA commented: thanx alot:) +1
hericles 289 Master Poster Featured Poster

You are going to need a database of some kind. Cookies are only stored on the user's computer and so wouldn't be viewable by anyone else. The a click event would be processed, the color changed and the and the database updated with the new color.

hericles 289 Master Poster Featured Poster

Hi,
To increment the id_Student column all you needed to do was define the column as the primary key with auto increment. Assuming the id_Student is an integer data type the declaration would have been:

create table some_table(
id_Student int not null primary key auto_increment,
....)

Now whenever new data is inserted you don't include a value for the id_Student, mySQL will increment it automatically. You can alter the increment rate if the default of 1 isn't what you need.
As for searching and displaying data from a database you'd be better off looking for a tutorial online to show you how to do that. There are many to choose from.

hericles 289 Master Poster Featured Poster

You will need to use javascript functions to do this. You will need to create a javascript function and refer to it in the on click event of each table data item e.g.

<td id="table_1_R06C07" style="width:14%; height:17%; vertical-align:top; padding:1px 4px 1px 4px; border:1px solid #000000; " onclick="changeColor(table_1_R06C07);">

You will need to pass through the ID of the table cell so you know which one to alter (using the document.getElementById method of javascript). Thats enough of a start and it should have provided enough hints to google what you need:)

hericles 289 Master Poster Featured Poster

First thing to do would be to debug the code at the line comparing the two. Visually confirm they are the same.

Lusiphur commented: Thanks for at least trying :) Nobody else seems to have any thoughts on this one. +9
hericles 289 Master Poster Featured Poster

You are missing the keyword COLUMN:

cmd = New SqlCommand("ALTER TABLE " + ddl_sub.Text + " ADD COLUMN " + txt_desc.Text + " varchar(50) ", con)
kvprajapati commented: Yep :) +15
hericles 289 Master Poster Featured Poster

Considering C# is a web based language (C#.net) the answer is pretty obvious. Asp.Net can be coded in either VB.net or C# so if you know C# go right ahead and code in that.

hericles 289 Master Poster Featured Poster

You're missing the ' before the comma in this line:

sql += "'" + txtPostCode.getText()+ ", ";

Sometimes it just needs a new pair of eyes:)

hericles 289 Master Poster Featured Poster

Your problem lies in the fact that you check the user name and password, starting the timer and progress bar if they are correct, and then continue on to increment ctr and crr anyway. If the user name and password is accepted you want to step out of that code and move onto the next thing.
The easiest solution is to wrap the two code blocks in another if statement. If user name /password OK then continue else ctr increments.

hericles 289 Master Poster Featured Poster

If you have set it out OK it shouldn't shift when values appear. You can specify lengths, padding, etc for the controls so that the expected outputs can fit in them without them having to resize.

Can you post up your HTML and CSS so we have get a better understanding?

hericles 289 Master Poster Featured Poster

Any controls that you place on the page (the .aspx) that you want to use server side need to have an ID and the attribute runat="server". You can then access on the code-behind page by using its ID.
For example, if you had a text box :

<asp:Textbox id="textBox1" runat="server" />

It could be accessed with:

textBox1.Text = "Hello World"

If a control is clickable (such as a radio button, button, etc) you also need to specify the onCLick="someMethod()" in the .aspx page and then include the same method in the code behind. For a button it would be:

<asp:Button id="button1" runat="server" text="Click me" onCLick="button1_Click" />

code behind:
sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) 
...
end sub

I hope that helps. The MSDN site is pretty useful when starting out (or at any other time...)

hericles 289 Master Poster Featured Poster

I think you would need to enter either the time the task was started and the time to complete or the calculated end time (as a time stamp) into a database. Then you could read the value whenever you needed to inform the player of the time remaining. I have the need to do this in one of my own projects (which is moving ahead very slowly) but I haven't got around to this part yet so I'll be interested in the responses.

hericles 289 Master Poster Featured Poster

You can use CSS to move the second one to the left:

<style>
sup {margin-left: -5px;} // or whatever suits
</style>
hericles 289 Master Poster Featured Poster

To JOIN a third table just add another 'JOIN tableName' and another 'ON...'

SELECT mm.stuid, mm.mark, sm.subname, sm.subtype, em.examname FROM subjectmaster AS sm JOIN markmaster AS mm ON sm.subid = mm.subid JOIN exammaster AS em  ON sm.examcode = em.examcode;
hericles 289 Master Poster Featured Poster

You will need to break out the information into more tables. You will need one table for registered guests (an id, their name, contact info, etc) and another for bookings. The bookings table will have a booking id and a guest id which links to the guest table. Then a guest can have multiple bookings matched against their one guest id.
The guest wouldn't need to know this guest id, you guest table would need to contain enough info to accurately describe him (first and last name, dob, maybe cell phone or email,

hericles 289 Master Poster Featured Poster

Whenever you need to join tables you use the JOIN command and then specifiy which columns in the joined table form the linkage (are the same).
For your tablesto get stuid and subname the query would be:

SELECT mm.stuid, sm.subname FROM markmaster AS mm JOIN subjectmaster AS sm ON mm.subid = ms.subid;

The AS command lets you give shorter aliases to a table if you didn't already know. And you can specify a WHERE clause on the end if you need to. You should be able to add in the exammaster table from there, just use another JOIN and ON statement.

rch1231 commented: Short and sweet and a good example. +9
hericles 289 Master Poster Featured Poster

Hi,
If the ! in the loop was stopping the process, reverse the if statements.
if(dsSrcStaf.Tables("Staff2").Rows.Count() > 0) {
// some rows exist so place you binding code here
} else {
// display "no records found" message
}