dickersonka 104 Veteran Poster

nice job catching your mistake

also do the the validate before repaint

dickersonka 104 Veteran Poster

you can do something like return a boolean

public boolean loadFile(){
boolean readFile = Boolean.FALSE;

try {
  //load file
  readFile = Boolean.TRUE;
} catch (IOException e) {
            e.printStackTrace();
} finally {
        if(in != null)
           in.close();
}

return readFile;
}

//your calling code
if(loadFile()){
 //continue
} else {
  //we need to tell the user that the file couldn't be loaded
}
dickersonka 104 Veteran Poster

you can pass parameters using

<applet .....
<PARAM name="param" value="value">
</applet>

in your init

String param = getParameter("param");

just do conversion to int, but you are specify width and height already, but thats how pass them

dickersonka 104 Veteran Poster

not so sure about the dreamweaver thing, i normally use visual studio

as far as what you need to do, you need to loop through each selected checkbox for the airport / user

this will prob best be supported in multiple inserts, rather than trying to do it with a single insert

do you have the code where you are populating the values to insert in the database?

dickersonka 104 Veteran Poster

haven't used the first, have used visual source safe and just really didn't care for it

i use subversion, very easy to setup, very robust and the client apps are good as well, the developers are constantly improving it also

dickersonka 104 Veteran Poster

its not about the mac, its about the browser, safari i assume

try to set this on the table style and see if it corrects it

empty-cells:hide;
dickersonka 104 Veteran Poster

i guess just to be thorough, he is what form2 could be

public class Form2 : Form
{
//all the other code
private int int_a;
public int IntA
{
get { return int_a; }
}
}
dickersonka 104 Veteran Poster

whoaaa, just use a dialog

and i would use that ref, just use, properties in the second form

Form2 form2 = new Form2();
form2.ShowDialog();

if(form2.DialogResult == DialogResult.OK)
{
myClass class = new myClass(form2.IntA, form2.IntB);
}
dickersonka 104 Veteran Poster

what about when you put the class inside the same file?

dickersonka 104 Veteran Poster

make it public

public class classinprac1
dickersonka 104 Veteran Poster

i would suggest, not saying this is for sure the answer, using transactions with READ COMMITTED or REPEATABLE READ

this way while changing or selecting data, you ensure that it can't be modified while selecting or read until don't processing

http://msdn.microsoft.com/en-us/library/ms173763.aspx

dickersonka 104 Veteran Poster

how about

int myValue = 6000;
Debug.WriteLine(Convert.ToString (myValue, 2));

little less lines of code

ddanbe commented: nice! +2
dickersonka 104 Veteran Poster

concurrency issues won't only be the result of updates, but from what you described what you were worried about, you only described about the amount of load on the system

how many users do you anticipate using your system at once? and is it a shared system, both web and db server?

dickersonka 104 Veteran Poster

i think you are seeming to be worried about the load, vs the concurrency

i would suggest using stored procedures with transactions

there is no problem with inserts, as long as they won't bust unique constraints or allow a user to join against them, when data isn't finished being populated

selects may involve 100-2000 records, for multiple clients, as long as the server can handle the load, then its not really a concurrency issue

here's an article that might be of interest
http://blog.sqlauthority.com/2007/04/27/sql-server-2005-locking-hints-and-examples/

dickersonka 104 Veteran Poster

it will allow up to 4

i would either go with some client side code, or used a stored procedure that will check the length before inserting and reject the data

this does sound more like a business rule, so i would say keep it in the business logic portion of the app

dickersonka 104 Veteran Poster

i would create a method called isInSet and you iterate through the characters and check, you can't do a character check the way you are wanting to unless you add them to a list or an array of some sort

dickersonka 104 Veteran Poster

just make sure not to call form.Hide()

you might also show other forms as dialogs depending on your needs

dickersonka 104 Veteran Poster

either go with a timestamp or id column, assuming its an integer or bigint

select * from table order by idcolumn desc limit 10

select * from table order by timestampcolumn desc limit 10
dickersonka 104 Veteran Poster

and you are getting 0's for everything after you put in lets say 3 entries?

dickersonka 104 Veteran Poster

hmmm, i have the same code and it is working for me

this piece is above the while loop

if (grade>=0 && grade<=100)

the piece of code i meant

if (highest<grade){
				highest=grade;
				}
				if (lowest>grade){
				lowest=grade;	
				}

needs the bottom if to be changed to

if (highest<grade){
highest=grade;
}
if ((lowest>grade)  && (grade > -1)){
     lowest=grade;	
}
dickersonka 104 Veteran Poster

read closely at my previous post

notice 100.0

Apercent = (((double)Acounter/counter)*100.0);

i know you have an if statement before the loop, the problem is that you are reading inside the loop for it to terminate, thats why you need that check in there

grade = input.nextDouble();

that is inside the loop and won't hit your if check

dickersonka 104 Veteran Poster

looks like lowest grade needs to be changed a little bit

if ((lowest>grade)  && (grade > -1)){
     lowest=grade;	
}
dickersonka 104 Veteran Poster

what about this

Apercent = (((double)Acounter/counter)*100.0);
dickersonka 104 Veteran Poster

sure feel free
it won't be that hard once you get the concept

for your new questions close out this thread and start a new one

look forward to your new questions

keith

dickersonka 104 Veteran Poster

area codes are a little tricky and sort of hard to get a direct correlation with a physical location

i think it would be best to leave them separate

for example atlanta has 3 area codes, but those area codes are also used in other cities, suburbs also share those 3 area codes, multiple cities, sharing duplicate multiple area codes

plus a user can have an area code from another place if they moved

very good, aren't you happy with this diagram compared to how you started?

so what is your next step with this?

dickersonka 104 Veteran Poster

Lol always helps to have a second set of eyes.

Sure just give the link for your new diagram and i'll check it out.

dickersonka 104 Veteran Poster

yes sequential inserts into the rest of the tables after user, the ripple effect you are wanting, is only on updates and deletes, you can't necessarily insert and populate tables the way you are wanting without triggers, but thats a whole different story

now the location thing
what you were allowing with the way you had it before was a user to have a city that wouldn't belong to the correct country, postal, or area code and vice versa

think of it just as you stated it, a country has area codes, area codes have cities, cities have postal codes

(the area code doesn't necessarily match because its phone based, but anyways)

take for example there is a toronto us and canada

we will take area codes out of this example

country
1 us
2 canada

cities
cityid cityname countryid
1 toronto 1
2 toronto 2

postal codes
postalcodeid postalcode cityid
1 11115 1
2 11116 1
3 45428 2

that is the concept, also you i don't know about how canada is, but countries have states, states have cities, cities have postal codes, which maybe states is what you are meaning area codes

dickersonka 104 Veteran Poster

sorry i mistyped my id from before, you were correct, it should be 1 2 3

dickersonka 104 Veteran Poster

also your city, country, and area code tables are out of sync

the way you have it, a city could have a different postal code, different country and different area code

the relationship should be
country --> areacode --> city -->postalcode

a country has area codes, which has cities, which have postal codes

dickersonka 104 Veteran Poster

yes, you can drop users_airports_link

i don't know which 3:37 post is, but i assume its the one with the data

airports
aid airport code
1 hartsfield ATL

services
1 movies on board
2 international flights

users
uid usr_fname
1 john
2 jane

userairportservices
uas_id user_id service_id airport_id
1 1 2 1
2 2 1 1
2 2 2 1


this will show user_id 1 (john) has international flights at atl

this will show user_id 2 (jane) has international flights and movies at atl

dickersonka 104 Veteran Poster

But the choice of which services they have should only be made after the airport relationship is defined.

i thought this meant airports have different services

this table structure can be used, or you can use this one

userairportservices
user_airport_service_id
user_id
airport_id
service_id

and drop the airportservices table

dickersonka 104 Veteran Poster

the airport services will have something like this

as_id a_id s_id
1 1 1
2 1 2

services
1 movies on board
2 international flights

userairportservices
uas_id user_id as_id
1 1 2


this means the airport offers two services, but the user only has access to 1 service, userid of 1 can only have a service of international flights at airportid 1, but airportid 1 offers 2 services

dickersonka 104 Veteran Poster

yep that looks good, the other way to do it would be to replace user_id in user_airport_services with user_airports_link, but there could be a constraint violation if the user was ever removed from an airport

what do you mean as far as the user inserting into the tables?

dickersonka 104 Veteran Poster

create two tables, airportservices and userairportservices

airportservices
AIRPORT_SERVICE_ID
AIPORT_ID
SERVICE_ID

userairportservices
USER_AIRPORT_SERVICE_ID
USER_ID
AIRPORT_SERVICE_ID

this will allow airport services to hold the services at the airport and the userairportservices to hold the relationship between user and airport_service

dickersonka 104 Veteran Poster
dickersonka 104 Veteran Poster

make sure the sql server service is running

dickersonka 104 Veteran Poster

how is this random?

  • articles with higher values of 'type' appear first
  • then all the articles with 'type=0' should appear at the end
  • then all the articles with a low section ID should appear

you need to pick one or the other, sorting with type and section or not

i don't see how you can have both

dickersonka 104 Veteran Poster

after insertion do this

Response.Redirect("../Prototype/AddConfirm.aspx");

normally postback will occur to your same page, but postbackurl changes to the other page, thats why your insert doesn't occur

dickersonka 104 Veteran Poster

row count is easy, just use

select count(*) from table

what is the character set of the db?

dickersonka 104 Veteran Poster

here is some pseudo-code for you

List<Book> usefulBooks;
int cashAvailable = cash;
booklist = query books by usefulness descending
for(Book book : booklist)
{
if(cashAvailable - book.getPrice() > 0)
{
//add the book
usefulBooks.add(book);
//decrement our cash
cashAvailable = cashAvailable - book.getPrice();
}
}
dickersonka 104 Veteran Poster

here is the sql code to get it

SELECT
sysobjects.name AS "TABLE_NAME", 
syscolumns.name AS "COLUMN_NAME", 
systypes.name AS "DATA_TYPE", 
syscolumns.LENGTH AS "LENGTH" 
FROM         
	sysobjects 
INNER JOIN 
	syscolumns ON sysobjects.id = syscolumns.id 
INNER JOIN                      
	systypes ON syscolumns.xtype = systypes.xtype 
WHERE     
(sysobjects.xtype = 'U') and
sysobjects.name = 'MyTableName'
ORDER BY sysobjects.name, syscolumns.colid

then in your your datacolumn, you will set maxlength to the value returned from the query for length

ddanbe commented: whew cool! +1
dickersonka 104 Veteran Poster

you should do this code side, rather than database side

34 = 00034 as far as numeric terms

if you want it display that way in a query use leading zeros

here's how to do it in sql server
http://www.sqlusa.com/bestpractices2005/padleadingzeros/

dickersonka 104 Veteran Poster

same thing as in the forum PreparedStatements

http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html

dickersonka 104 Veteran Poster

manipulate the filename before creating the saveFile

string newFile = FileUpload1.FileName;
newFile = "myfilename_" + newFile;
saveFile = Path.Combine(savePath, newFile);
bharatshivram commented: thanx for the reply.. worked fine +2
dickersonka 104 Veteran Poster

and tcpip is available?

if so, make sure your connection string is correct

dickersonka 104 Veteran Poster

the sql server machine needs to be configured with that because it is the "remote" machine

dickersonka 104 Veteran Poster
dickersonka 104 Veteran Poster

this is asking for disaster

Player temp = new Player(dataFile.nextLine(), dataFile.nextLine(), dataFile.nextFloat(), dataFile.nextFloat(), dataFile.nextInt(), dataFile.nextInt());

separate that out and find out where its messing up
example

String str1 = dataFile.nextLine();
String str2 = dataFile.nextLine();
//....
Player temp = new Player(str1, str2, ...);
dickersonka 104 Veteran Poster
dickersonka 104 Veteran Poster

for some reason the file doesn't start with a eof character does it?

try recreating the file and make sure its closed