Slade 66 Practically a Master Poster

Hmm well, this is what I have so far and it works.

CREATE procedure sf_GetMemberInfo
@ArtID int output,
@Title nvarchar(200) output,
@ArticleHits int output,
@UserID nvarchar(20),
@Info nvarchar(1000) output,
@Notes nvarchar(3000) output,
@Favurl nvarchar(60) output,
@FavText nvarchar(200) output,
@PageHits int output
AS
SELECT
@ArtID = ArtID,
@Title = Title,
@ArticleHits = sf_articles.Hits,
@UserID = sf_articles.UserID,
@Info = Info ,
@Notes = Notes,
@Favurl = Favurl,
@FavText = FavText,
@PageHits = sf_Members.Hits + 1

FROM sf_articles, sf_Members
WHERE sf_articles.UserID = @UserID
AND
sf_articles.Hits = (Select MAX(Hits) from sf_articles where UserID = @UserID)
AND
sf_articles.UserID = sf_Members.UserID
UPDATE sf_Members
SET
Hits = Hits + 1
WHERE UserID = @UserID
GO

I guess I"ll have to make an additional query to get the total hits and the total number of records. The above is to work in unison with my asp .net app. I will post a simplified version later.

Slade 66 Practically a Master Poster

But the only problem is, I only want to select the records which have the highest hits for each user. If I group by userid, then it singles them down a record from each user. But if I group by userid and artid, then it shows all the records :(. So is there any way to select the record with the highest number of hits for each user?

Slade 66 Practically a Master Poster

Hi guys here is my working sql query

Select MAX(Hits)'Hits', SUM(Hits)'Total', UserID
From sf_articles
Group By UserID

My problem is, when I want to select other columns as well as the current ones. It gives me a lovely error:

Server: Msg 8120, Level 16, State 1, Line 1
Column 'sf_articles.ArtID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

Basically what I want to do is get those columns, and get the info from the records that contain the maximum hits.

For example. I have two records, one with 2 hits, the other with 5. I want to get all the info from the one with 5 hits. There will be an end result of about 7 records at the end since there are 7 users.

PLEASE HELP! I AM TEARING MY HAIR OUT!

Cheers,

Slade

Slade 66 Practically a Master Poster

Tekmaven, will you give me a hand if I find it difficult to adapt David Barret's control? By the way, something weird there... In the text file it says he doesn't have the upload function working, but in the fixes section it says he got it fixed in 1.2... currently on 1.2.1 hehe.

Anyways, I'll find out when I give it a shot.

Thanks guys

Catchya

Oh by the way, that dotnetgallery is really cool except I'd like to try david barrets control before I purchase it.

Slade 66 Practically a Master Poster

:D there's a beta?! All hail tekmaven. I've got to check this out.

Slade 66 Practically a Master Poster

SRV -> Amphibian

Slade 66 Practically a Master Poster

for the goats.

Slade 66 Practically a Master Poster

anyone have any suggestions for specific operating systems? e.g. xp pro vs. lindows?

Slade 66 Practically a Master Poster

I recently post a thread asking if IIS can run on XP Home Edition. The answer that I got is NO. I recently upgrade my laptop to Windows XP Professional. I really want to start learning ASP. Can I now just start writing ASP codes or do I now have to do something else before.
Thanks.

Depends, do you have IIS installed? If not, rip out your windows xp cd and install it. Now, you want an environment? I use visual studio .net 2003, but I've heard of one called asp matrix or something? Perhaps you should investigate that one :D

Slade 66 Practically a Master Poster

hey guys... I want to be able to auto sort rows ascending in a worksheet according to the first column... I want to make a visual basic macro for this... any ideas?

Thanks in advance

Slade 66 Practically a Master Poster

I have never lost somebody so close to me, I have never experienced your pain before... I know the day will come, I fear it. I think to myself that they will go to a better place and everything will be well, I will see them again some day. But it still scares me... alot. You are a strong person Danni, and even though I know this thread is old, you will be fine. :D

MY SITE IS NEARLY UP! (change of mood) :D

Slade 66 Practically a Master Poster

Hey, I'm developing an application that will ultimately be like a mail merge. What a user will do is select a persons name from a drop-down list and the fields will fill in according to the other info in the table of that persons record. They can from there print it. Another function I would like to add is it can print letters for the last 30 records.

I am using asp .NET, vb .NET and T-sql. I hope you guys can help out :D

Any help is appreciated even if you re-direct me to another reference.

THANKS!

Slade

Slade 66 Practically a Master Poster

lol sorry, I didn't ask you to do the assignment for me! I just meant why should I compare windows and linux? Why not Windows and mac?

Slade 66 Practically a Master Poster

Hey guys! I thought I'd ask the pro's, I have to do a comparison between two operating systems for an assignment. Which two would you recommend and why?

Slade 66 Practically a Master Poster

lol not quite, I remember dragging my work to and from school on floppy's presented to be a bit of a problem though. Because I was running an earlier version of office, there were supposedly compatability issues and every now and then I'd take my work to school and it would just come up as all symbols hehe, got out of handing in poor projects many a time for that one :P

Slade 66 Practically a Master Poster

Thanks guys! Just downloaded both solutions, will let you know which one I find best :D

Slade 66 Practically a Master Poster

Have you got any tips on skinning the forums?

Slade 66 Practically a Master Poster

I want to set up a computer on my network that downloads windows updates and then computers on the network download them automatically off that computer. Is there a way to do this?

EDIT: Windows xp btw

Slade 66 Practically a Master Poster

panda with pink

Slade 66 Practically a Master Poster

ghetto -> moron

Slade 66 Practically a Master Poster

cromwell approval in

Slade 66 Practically a Master Poster

, releasing control art

Slade 66 Practically a Master Poster

dolichocephalic -> antidisestablishmenterrorism

Slade 66 Practically a Master Poster

galapagos -> Lineage

Slade 66 Practically a Master Poster

Like CatWeazle said, you don't compare the two. Service pack two has fixes that improve on the fixes contained in service pack one. Hence the term "Service Pack" sp1 is the first service pack, and sp2 will be the second.

Slade 66 Practically a Master Poster

ewe -> sheep

Slade 66 Practically a Master Poster

Hey Dani, how are you feeling, how did it go? Are you out yet? GET BETTER! I gotta go for some surgery on my teeth hehe, seems my wisdom teeth are causing all sorts of havoc.

Slade 66 Practically a Master Poster

Hey, Adobe is great for making graphics, but be careful using the HTML their products produce from slicing. It tends to write bloated code at times and it is somtimes not as cross browser compatible as it should be.

I know what you mean about the bloated code... it's ridiculous. Anyway, I don't use adobe to generate html, I just slice the images up and save them as seperate files, then use them in my code :D.

Slade 66 Practically a Master Poster

insanely cool. Babies

Slade 66 Practically a Master Poster

funny -> sad

Slade 66 Practically a Master Poster

their own babies

Slade 66 Practically a Master Poster

pirate -> maddox

Slade 66 Practically a Master Poster

Ok, to lay the whole thing to rest, here is the guide to makign an operating system :)

1) VB is a high level language. it doesnt contain any code which can directly access the hardware. therefore, it relies on windows' ability to access the hardware in the system to function. it is NOt possible EVER to get VB to talk directly to the hardware.

2) You CAN'T install the runtime without having windows on the system. the runtime is effectivly, and add-on for windows which allows you to run VB programs. It uses DLL's, which when loaded, provide functions that programs can call. You can only load a DLL by calling it from a program within Windows.

3) It IS possible to write an operating system in QBasic, but it isnt easy. I wrote one to see if it can be done. you need to write assembly instructions for everything. even simple functions like displayin text need to be written from scratch, as every call that qbasic makes uses DOS in some way.

4) As for booting the system, a generic boot sector, which can load an EXE file is fine. However, you couldnt use this to load a windows or dos exe file, as it relies on windows, or dos to provide the routeens to access the hardware.

Man of the hour

Slade 66 Practically a Master Poster

I -> aye

LMAOWBOIAS

Slade 66 Practically a Master Poster

perception -> eye

Slade 66 Practically a Master Poster

a rancor baby

Slade 66 Practically a Master Poster

wouldn't shut the

Slade 66 Practically a Master Poster

needsome -> misconstrewed

Slade 66 Practically a Master Poster

Not to sound un-appreciative or anything but, I didn't notice it, nor do I mind. It's fine, whenever you tweak it it's fine. You've done great so far but there are always going to be improvements to make so... People just get used to it then you change it... who cares?

Anyways, I wrote this when half-dead

Slade

Slade 66 Practically a Master Poster

relax -> sleep

Slade 66 Practically a Master Poster

hippos -> pressure

Slade 66 Practically a Master Poster

Sorry it's taken me so long to reply but I haven't been abel to get to my code, I'm flat out. So I'll just give you an example of what I'm trying to do:

I created this application at work, but it uses the same technique I'm trying to use on my website with the text data type... it just isn't working.

my TSQL

CREATE procedure JobAdd
@PositionTitle nvarchar(50),
@ReferenceNo nvarchar(10),
@Location nvarchar(30),
@ClosingDate smalldatetime,
@JobDescription nvarchar(1000),
@Requirements nvarchar(1000), 
@Email varchar(75), 
@JobID int output
AS
INSERT INTO JobVacancies
(
PositionTitle,
ReferenceNo,
Location,
ClosingDate,
JobDescription,
Requirements,
Email 
 
)
VALUES
(
@PositionTitle,
@ReferenceNo,
@Location,
@ClosingDate,
@JobDescription,
@Requirements,
@Email 
 
)
SELECT @JobID = @@IDENTITY
GO

Something like that...

My vb .net code

PrivateFunction AddVacancyDetails() As Int32
 
Dim myConnection AsNew SqlConnection(ConfigurationSettings.AppSettings("strSqlConnectionString")) 
Dim myCommand = New SqlCommand("jobAdd", myConnection) 
myCommand.CommandType = CommandType.StoredProcedure 
 
Dim paramPosition As SqlParameter = myCommand.Parameters.Add("@PositionTitle", SqlDbType.NVarChar, 50) 
paramPosition.Value = txtPosition.Text 
 
Dim paramLocation As SqlParameter = myCommand.Parameters.Add("@Location", SqlDbType.NVarChar, 30) 
paramLocation.Value = txtLocation.Text
 
Dim paramClose As SqlParameter = myCommand.Parameters.Add("@ClosingDate", SqlDbType.SmallDateTime) 
paramClose.Value = dtClose.SelectedDate.ToShortDateString()
 
Dim paramRef As SqlParameter = myCommand.Parameters.Add("@ReferenceNo", SqlDbType.NVarChar, 4) 
paramRef.Value = txtRef.Text.ToUpper
 
Dim paramDescription As SqlParameter = myCommand.Parameters.Add("@JobDescription", SqlDbType.NVarChar, 1000) 
If txtJobDescription.Text = "" Then 
paramDescription.Value = DBNull.Value 
Else 
paramDescription.Value = txtJobDescription.Text 
EndIf
 
Dim paramRequirements As SqlParameter = myCommand.Parameters.Add("@Requirements", SqlDbType.NVarChar, 1000) 
If txtReq.Text = "" Then 
paramRequirements.Value = DBNull.Value 
Else 
paramRequirements.Value = txtReq.Text 
EndIf
 
Dim paramEmail As SqlParameter = myCommand.Parameters.Add("@Email", SqlDbType.VarChar, 75) 
Dim at AsString 
at = txtEmail.Text.IndexOf("@") 
If at = -1 Then 
paramEmail.Value = txtEmail.Text & "@goldenwest.org.au" 
Else 
paramEmail.Value …
Slade 66 Practically a Master Poster

into zorbskies face

Slade 66 Practically a Master Poster

diversion -> spy

Slade 66 Practically a Master Poster

abusers -> court

Slade 66 Practically a Master Poster

into a jar

Slade 66 Practically a Master Poster

you being able to see it means it was connected properly... hmm is it on a channel by itself? If so make sure it is the master drive, if it is on an IDE channel with another cd-drive, you must make one master and one slave, if it is on an IDE channel with a hard drive, I would suggest making the cd-rom slave and the hard drive master... Although windows detecting it makes me believe there is no issue there. Perhaps the cd-rom is broken? Are you certain it's working properly?

Slade 66 Practically a Master Poster

ah... you're spinning me out here. What can you see when you go to my computer?

Slade 66 Practically a Master Poster

so, you've tried inserting a cd and it tells you the hard drive isn't plugged in is that it?

Slade 66 Practically a Master Poster

I have no sound card in my old comp im putting back together..Do I have to have one in order to make the CD-Rom work? I dont have an extra one to put in it or the $$ to go buy one at the moment. If there is any way around it i need a way to use the cd-rom

You don't need a sound card to run the cd-rom drive, why? Doesn't the drive work?