kplcjl 17 Junior Poster

To give you a little more insight in the English language, "in site" is basically a meaningless collection of two real words that would sound exactly like "insight". Site is (sort of) a specific location, you can't be in it, but you can be in a building or a hole in the ground that is on-site. Sight is related to seeing, but insight is related to seeing interactions in your mind and gaining the insight(understanding) into how they relate to each other.
A University campus is a site that can encompass several blocks and buildings, yet is still one site.

djjeavons commented: Why? -1
kplcjl 17 Junior Poster

Sort of looks like a VB language version. Have no idea how that all works. In .NET you have Dictionary(TKey, TValue) Constructor (System.Collections.Generic) that can be used. This will NOT sort the data, but will efficiently determine if the word is unique. I don't see how the above code snippet could do that. You can set the TValue type to bool, value to true, and ignore it. You can then transfer the Keys list into an array and use the built-in array.Sort function.
If you aren't using .NET, I don't have the experience to help you.

TrustyTony commented: Out of topic, this is Python forum -3
kplcjl 17 Junior Poster

OK, people (including me) are talking to you like you would understand what we are saying. That's not working. Think of scope, I moved the arrays outside of the main routine to make the arrays globally available. Others said you should use the for loop to reach all the arrays in parallel. That's correct, I've supplied a routine to show how that works. In that routine, "i" is an iterator. I used "i" over and over to show its scope is local and independent in each of the routines. Check out and understand what "i" is doing in each of the arrays. Someone else said you could use the foreach but then you would have to independently maintain the iterator. That's true too. Didn't give an example on how that would work.

/// <summary>
        /// parallel array of class names
        /// </summary>
        private static string[] classes = { "CS150", "CS250", "CS270", "CS300", "CS350" };
        /// <summary>
        ///  parallel array of people currently enrolled in each class.
        /// </summary>
        private static int[] currentEnrolled = { 18, 11, 9, 4, 20 };
        /// <summary>
        ///  parallel array of maximum enrollment in each class.
        /// </summary>
        private static int[] maxEnrollment = { 20, 20, 20, 20, 20 };
        /// <summary>
        /// Goes through the currently enrolled count and sums it.
        /// </summary>
        /// <returns>total enrolled in all classes</returns>
        private static int currentEnrollment()
        {
            int enrolled = 0;
            foreach (int i in currentEnrolled)
            {
                enrolled += i;
            }
            return enrolled;
        }
        private static …
kplcjl 17 Junior Poster

>it casted the timespan asd but it gives me more errors, can anyone please help me?
Maybe you should look at your monitor through a mirror, because you seem to be naturally backwards.

Well, at times I can't help being sarcastic, but I certainly have to take a back seat to you. You would think a code goddess would know mere mortals can't know everything and give them a break. (Yes, I know its funny watching puny creatures fall down and go boom. Still, isn't it better to get them standing, so they'll fall from a better height?)

Narue commented: Oh my god, go get yourself a sense of humor. -4
kplcjl 17 Junior Poster

Hint:
1. READ ALL the PROPERTIES built into your objects.
2. UNDERSTAND them.
However, once you've read a property name like ReadOnly, how hard would that property be to understand?

kplcjl 17 Junior Poster

1. It is poor design to have a character field value added to a table that is contained in another table instead of referencing the table (IE WindowID)
2. It is poor design to use (char) for fields that don't have a fixed number of characters
3. It is poor design to not use an order by statement when you aren't using selection criteria and only taking a piece of the information.
That said:

--initial test tables
SET NOCOUNT ON
DECLARE @tblUsers table (UserID int primary key, FirstName varchar(20), LastName varchar(20), BirthDate smalldatetime)
DECLARE @tblDueVisits table (UserID int, DueDate smalldatetime, WindowName varchar(20) null)
DECLARE @tblWindows table (WindowID int identity, WindowName varchar(20) null)
--initialize tables
declare @dtnow smalldatetime, @id int,@txt varchar(3),@rw int 
select @dtnow='20091105',@id=1
WHILE @id < 100
BEGIN
	set @txt=@id
	insert into @tblUsers values (@id, 'First' + @txt, 'LastName' + @txt, dateadd(year,-@id,@dtnow))
	insert into @tblWindows values ('WindowName'+@txt)
	select @id=@id*2,@rw=@@identity
	WHILE @rw > 0
	BEGIN
		insert into @tblDueVisits values (@id, dateadd(day,@id*@rw,@dtnow),null)
		set @rw=@rw-1
	END
END
set nocount off
--SELECT * FROM @tblUsers
--SELECT * FROM @tblWindows
--SELECT * FROM @tblDueVisits
SET NOCOUNT ON
-- Process requirement
SET @id=16
DECLARE @tbl1 table (ID1 int IDENTITY, DueDate smalldatetime)
DECLARE @tbl2 table (ID2 int IDENTITY, WindowName varchar(20) null)
INSERT INTO @tbl1 SELECT DueDate FROM @tblDueVisits WHERE UserID=@id
SELECT @rw=@@ROWCOUNT
INSERT INTO @tbl2 SELECT TOP (@rw) WindowName from @tblWindows
Update @tblDueVisits set WindowName=c.WindowName
from @tblDueVisits a
join @tbl1 b on a.DueDate=b.DueDate and UserID=@id
join @tbl2 c on ID1=ID2
select * from …
kplcjl 17 Junior Poster

Hello,

I want to create database on SQL Server using Javascript and HTML. User will input following data. Server Name, Database name, File Sizes. When I will click "Submit" button database should be created on Selected server with entered name. I am using Client side HTML and Javascript.
we need to create database according to some standards thus we are preparing graphical user interface.
Quick response will be appreciated.

Thanks, Rahul

Impossible. Javascript is not designed to do work on another server, it is client side software that only runs on the client. Both HTML and JavaScript can post to a cgi which could do something like this. If the server name entered also hosts the cgi, Javascript could post the instructions to the server name's cgi and let it do the work. That or the client hosts the cgi and the user account has access to the server name.

kplcjl 17 Junior Poster

1. sumdollaramtDecimal has to be more than 0 for any sum to be added to it. This looks like a logic error. Should that be If dollaramtDecimal > 0 Then sumdollaramtDecimal += dollaramtDecimal?
2. You need a process to transfer the text from the text box to the numbers you are using to track the order. That isn't shown. Are you sure that dollaramtDecimal has the calculations loaded before you cleared the boxes? Something like

if IsNumeric(quantityTextBox.Text) and IsNumeric(dollaramtTextBox.Text) Then
Dim i int32
i = quantityTextBox.Text
dollaramtDecimal = dollaramtTextBox.Text
dollaramtDecimal *= i
End If

kplcjl 17 Junior Poster

So many problems in so few lines
1. If you "Try Catch End Try", DO SOMETHING after the Catch. This function goes blythly on when the most blatent errors can occur. (IE it would run OK on my machine with your connection string. Or would it? Everything fails in the try blocks. Is Do Until Nothing <> newPhoneID an infinite loop? It still runs because this loop would eventually cause an exception.)
2. Have you debugged this function? IE stepped through the function step by step making sure your code isn't blowing up.
3. functions expect to return an object. IE in this string function execute "Return newPhoneID". With txtPhoneID.Text being set, this is basically a Sub. It should be txtPhoneID.Text = CreateNewPhoneID() if you want this to be a function.
4. Nothing in this function changes the database, is something else doing so?
5. Does the string set a phone id that doesn't exist?
6. Database developers - shut your eyes, walk away. (Shaking your head while doing so is OK.)