padtes 30 Junior Poster in Training

I this was already solved, please mark so. Otherwise here is variation of the same:

CREATE TABLE #TABLE (
employeeid VARCHAR(10),
projectid VARCHAR(10)
,num1 INT
,num2 INT
)

DECLARE @SqlQuery NVARCHAR(4000);

SET @SqlQuery=' INSERT INTO #TABLE SELECT TOP '+CAST(@no_of_rows AS CHAR)+'tblEmployee.id ,
      tblProject.ID, 0,0
      FROM tblBilling (NOLOCK) '
      
      EXEC(@SqlQuery)

please close thread if this or earlier solution has worked

padtes 30 Junior Poster in Training

Are you sure you want
sql3=sql3 = "UPDATE performances SET Status=booked WHERE performanceID='" & performanceID &"'"
OR
sql3= "UPDATE performances SET Status=booked WHERE performanceID='" & performanceID &"'"

Can you check and revert if that fixed it for you?

padtes 30 Junior Poster in Training

I don't have solution; but I observed @docname parameter is created but not added to cmd.Parameters collection. I would expect error but different one.
please mark thread solved if this helps

padtes 30 Junior Poster in Training

I would use a hidden variable runat server. I can find it in javascript like any other hidden var and use in C# as well.

padtes 30 Junior Poster in Training

Can you send more info like the error itself. Is the ASP page basically simple HTML only? Or is that the ASP output is not well-formatted HTML? Or ASP working is different than HTML working.

Need exact details of error / problem.

padtes 30 Junior Poster in Training

Refer http://en.wikipedia.org/wiki/Natural_logarithm

see sections
Numerical value
Continued fractions
Hope it helps

padtes 30 Junior Poster in Training

I have neither of the 2nd & 3rd option in my code.

action = the second page name

but If I remove this action element, it shows the same current page(without refreshing the page).

I actually want my current page to get reloaded after saving form data, when save button is clicked.

Please help!

To me, this means, your data is saved. Right? In ASP you will have to re-write the form values to the page. (In dot net, there is viewState and framework that takes care of it)

For ex. if you have one text box.

<input type='text' name='txtName' >
<button ...>

Now, when page is submitted, you got the value from Form and saved it. So you have to take that value and re-assign. Means code changes to:

dim aName
aName = Request["txtName"]
'save aName to database... that is upto you

<input type='text' name='txtName' value='<%Response.write aName %>'>
<button ...>

you could use <%= shortform for response.write.
Tell me if it helps

padtes 30 Junior Poster in Training

if the purpose of the button click is to increase the logo by 10 each time, then you are also missing LogoButton.Width = LogoWidth ; after you increase the value of the variable on buttonClick.

As for the error, cannot find what is causing it. Can you step through in debugger at all? put a breakpoint in button click. See what line causes it.

padtes 30 Junior Poster in Training

This might not help you much; since looks like Ok from the code posted above. Can you check if the table tblReservation in the database has as many (8 or more) columns as you are inserting here? If there are 7 or less columns, this will cause error.
Also I am not aware if there is "not null" constraint that applies to your database. If it does and if you are ignoring not-nullable columns, that too can cause some error.
Hope it helps.

padtes 30 Junior Poster in Training

Hey VB is not COBOL ...But one thing is true UPDATE ..And I AM UPDATED to .NET [ but still i am using VB 6 ].
DotNet is great than VB but VB 6 is still not become obsolete.One thing become obsolete when it has no use in this world.But VB6 has the power to produce what we can do in VB.net [except web ] and many people still using it for many years.
Microsoft never said it is obsolete...They just added Vb in .net with a very little extras.They are still publishing VB6 Service packs and controls and Tutorials .....Look at the codes in vb and .net they are same , same man ..........

" Your Believes Will Save You " hehehehe
What about c , c++.People are still using those old champs still for many powerful projects .

Try it ...
Best of luck ....

1. Wake up and smell .net. Either you have no clue of .net, OO paradigm, exception handling and concepts like that or you are just putting your ego in front of you and heheheheing the "reason".
How can you say a very little extras added to vb making it vb.net. It is complet dot net framework. It is called VB.net, it has not much to do VB.
2. You call you upgraded yourself in .net (though I doubt). But you want the other person to start with VB. That is like I will use …

padtes 30 Junior Poster in Training

Actually that is the default behavior.
Check
1. what "action" for the form is.
2. If you have "server.transfer"
3. "response.redirect".
If you already have solved, post the solution. If this solves close the thread.

padtes 30 Junior Poster in Training

VB.net.
If C# is choice, personally I will go for C#.
If you have C or java exposure go for C#.
No arguments. Mark thread as solved.

padtes 30 Junior Poster in Training

Alternate c# syntax for session I use: Session["userName"] = Textbox_userName.text; or

if (Session["userName"] == null)
  server.transfer("LoginPage.aspx");
else
  Label_userName.Text = "Welcome " + (String)Session["userName"];

Session is just like hastable, a collection of objects, one per user. Though you can store any object, on retrieval you will need cast it. Also try to keep minimum stuff in session.

Mark th thread closed if your problem is solved.

padtes 30 Junior Poster in Training

I used frames, though it is not a prefered solution; but is sure simple and guaranteed to work.

padtes 30 Junior Poster in Training

There are 2 ways to do this: using same page 2 panels or 2 pages for
1. data entry and 2. Confirmation. You can hide-undhide panels (panelConfirm.visible= true) if you decide only one page.
For one page solution:
By default, show data-entry panel , hide other. On submit, read text box etc and populate confirmation labels etc. Hide 1st and show other.
Now on canel or submit you show panels or server.transfer
If this helps, please mark thread as solved.

padtes 30 Junior Poster in Training

When you say data is updated in the database, you mean you have handled the page postback correctly.
Also you are saying the datalist is filled correctly when page is refreshed, that means, the datalist filling code is there and working AND the datalist depends on your latest update.
All you have to do is, logically, after updating database, fill the datalist and bind again. One of the standard practices is: add private method that will fill datalist. Call it on page load when not postback as well as call after database update.
If this helps, please mark thread as solved.

padtes 30 Junior Poster in Training

Though I don't know ColdFusion I will attempt this: use simple htm or html for frames. I use frameset in htm manu times.

And html will work with dot net or Coldfusion or anything else.

There got to be something else with browser version, not server technology. When you say you are loosing session variables, how are you detecting that?

Anyway frames are getting outdated. There might be some problem with newer browsers.

please mark closed if you find solution. If your solution is different than this, post the solution as well.

padtes 30 Junior Poster in Training

Need 3 loops, not 2. One for rows, one for spaces, one for stars. I don't know syntax of while you used; but here is sample (not tested/compiled) code:

for (rowNum=0; rowNum < rowCount; i++ )
{
    int blankCnt = (rowCount - rowNum) * 2 -3; //thanks to roswell67

    for (int i=0; i < blankCnt; i++ )
    {
    	System.out.print(" ");
    }
    for (int i=0; i<rowNum ; i++)
    {
	System.out.print("*");
    }
}

please mark thread as solved if this helps

padtes 30 Junior Poster in Training

A quick idea (not tested)

SELECT COUNTRY,
SUM(CASE WHEN Type='SALES' THEN COST END) AS SALES,
SUM(CASE WHEN Type='Expenses' THEN COST END) AS Expenses,
SUM(CASE WHEN Type='Taxes' THEN COST END) AS Taxes,
SUM(CASE WHEN Type='Profit' THEN COST END) AS Profit,
sum(when type in ('SALES','Expenses','Taxes','Profit') then cost end) as RowTot
FROM tbl_country_costs
GROUP BY COUNTRY
WITH ROLLUP
sknake commented: that is how I would do it +14
padtes 30 Junior Poster in Training

When you scream for help, shouldn't you put your solution when you find one?

padtes 30 Junior Poster in Training

To me it looks like you will have to write stored procedure, to handle the case of

If there is an uneven Quantity versus Student count, then the credits will be allocated from top to bottom, adding an extra to each of those students.

I cannot think of a single query (like some join) possibly doing it. Another thing I noticed is, you need to give a sample of input (records from 2 tables) and output expected. Your question is not all that clear to me

padtes 30 Junior Poster in Training

As I read it, you already mentioned MVC. View tells controller, controller updates model (or vice versa).
MVC is the pattern.
In addition, Observer can be used, where client subscibes to model and model notifies client(s).
There are java and php samples at http://www.fluffycat.com/Java-Design-Patterns/

padtes 30 Junior Poster in Training

why not hide the column in fillGrid method?

if (yourCondition) {
   gridview1.Columns[2].Visible = false;
}

See if this works.

padtes 30 Junior Poster in Training

In dot net, once you connect to a database, you have lists of all tables and for each table, list of columns available. Select * from each of the table and loop through all columns for all records.

Sounds like simple looping but might be whole lot of work for the machine.

padtes 30 Junior Poster in Training

ASP return HTML to browser. HTML understands <BR /> as break, not new line character. So replace your new line with <BR /> after you fetch from DB and write to response.

padtes 30 Junior Poster in Training

In addition to Scott Knake's suggestion, I also see logical problem. First you need to find year then semester at that year

ALTER PROCEDURE CurrentSemesterCourses

@StudentNo int

AS
DECLARE @Semester int
DECLARE @AcademicYear int

Set @AcademicYear =(SELECT TOP (1) AcademicYear
FROM ppu_RegistrationInfo AS ppu_RegistrationInfo_1
WHERE (StudentNo = @StudentNo)
ORDER BY AcademicYear DESC)

SET @Semester = (SELECT TOP (1) SemesterNo
FROM ppu_RegistrationInfo AS ppu_RegistrationInfo_1
WHERE (StudentNo = @StudentNo) 
AND AcademicYear = @AcademicYear
ORDER BY SemesterNo DESC)



SELECT CourseNo
FROM ppu_RegistrationInfoDetailes
WHERE (StudentNo = @StudentNo) AND (SemesterNo =@Semester) AND (AcademicYear =@AcademicYear))
padtes 30 Junior Poster in Training

As suggested by Scott Knake, find what the final SQL is, copy that and paste in query analyzer to see if that by itself. Syntax error given there are more informative. Other thing he suggested is paramterize your query. Otherwise, data with single quote will bomb the query, worst yet, it is prone to security flaw (google SQL injection)

padtes 30 Junior Poster in Training
select MakeName + '(' + cast((select count(*) from CarSale p where p.MakePK = m.PK) as varchar) + ')' dispField, m.PK
 from CarMake m

For MS SQL 2000 above code, assumes PK as primary key for join of CarSale and CarMake. Also assuming that you will need the PK as value member.
- PadteS

Acutually im populating DDL from one table(CarMake) and counting no. of records from another table(CarSale) means how many cars are there for sale of a certain CarMake.

padtes 30 Junior Poster in Training

I suggest a few steps; but if Javascript is disables, part of this will fail.
1. open the app as new pop-up window without menu/toolbars etc. (need JS)
2. disable right click (using JS)
3. disable back key (using JS, causes bad user experience)
4. Add "Expires" to HTML headers of each page that should be backed
However, on second thought, why not keep track of what questions are already answered, on server (may be session may be database) so that questions cannot be re-submitted.

Hope the discussion helps

padtes 30 Junior Poster in Training

It is more like logic problem than technology problem. Note that paint method is called everytime there is change in the Graphics. It is beyond your code's control. Which means every time something happens (like re-size / hide-unhide), Graphics gets refreshed, calling paint method.
Now you are drawing (fillOval) all the time, using the same size1, size2 variables. What you need is another class (structure) to save all the info that is related to a specific part of drawing, like points, line thickness, color etc. And your main drawing will be collection (like an Arraylist) of these structures. Your paint will use these instances paint.
Hope this gives you some direction to think.

padtes 30 Junior Poster in Training

read about Graphics object, there are more keywords I can think of: DrawLine
AddEllipse
Find details in MSDN or google for it
-Padte S