Fungus1487 55 Posting Pro in Training
SELECT startpost.posttitle, startpost.dat, creuser.username FROM startpost INNER JOIN creuser ON startpost.userid = creuser.uid

That will display all the startpost data with the username for the startposts. Specifying a Where clause like below will let you show one startpost record based on its id.

SELECT startpost.posttitle, startpost.dat, creuser.username FROM startpost INNER JOIN creuser ON startpost.userid = creuser.uid WHERE startpost.postid = 1

This is really quite basic and i suggest you read some articles explaining "JOINS" a good one is here w3schools

Fungus1487 55 Posting Pro in Training

Just gone drop a stone in the lake, I would go for PHP and MySQL, reason so far I found it MySQL better choice then MsSQL, secondly I'm not big supporter of ASP as website base, I find this technology mostly very slow

i agree when compared to writing php at first asp.net appears slower than it. But it is all down to the developer usually not being fluent enough at .net to understand what is going on behind the scenes and usually taking overly long routes to solve a problem. But again each to their own there is no "RIGHT" language.

Fungus1487 55 Posting Pro in Training

Hey hey,

this is an old VB ASP.net project i did, shouldnt be too hard for you to change the syntax.

Dim memSt As New System.IO.MemoryStream
        Dim imgMe As Drawing.Image = Drawing.Image.FromFile(Server.MapPath("me.jpg")) ' Get image
        
        imgMe.Save(memSt, Drawing.Imaging.ImageFormat.Gif) ' Save image to memory stream
        memSt.WriteTo(Response.OutputStream)

this example outputs the image to the output stream. you need to use a memory stream and not save it directly as when using this method with png's and bmp's the server outputs the image while it is not fully proccessed resulting in no image.

Fungus1487 55 Posting Pro in Training

hello

Fungus1487 55 Posting Pro in Training

I had stored a word file in database in "image field"
then I restore it in a byte array.
I want to convert this byte array into string to write it on the web page.

I am using ASP.NET 0.2 and SQL 2005.

thanks.

System.Text.Encoding.GetString(byte())
Fungus1487 55 Posting Pro in Training

you need to buffer the file to the page and add the right header for them to open it and not download it to there comp then open it.

you need to add the "Content-Type" header with a value of "application/vnd.ms-word"

this will open your document in the browser window.

Fungus1487 55 Posting Pro in Training

will you be looking to edit this document online then update what is in the database ?

also why bother storing this in a database and not just reference a local file ?

Fungus1487 55 Posting Pro in Training

strange. i thought the request would fail as you are asking it to exactly match the request.

can you Response.write(sql) the SQL statement to the screen to see exactly what is returned from the text boxes?

Fungus1487 55 Posting Pro in Training

I agree i would also almost always choose .NET simply for the complete lazyness that visual studio offers me as a developer.

Fungus1487 55 Posting Pro in Training

Hai All,

I want to create crystal reports dynamically, I don't know the columns i will take it from database at runtime, im getting all data into one dataset and im convrting dataset into xml schama, then im using that xml schama in crystal reports,there i drag n drop all fields in xml schama to crystal report, up to here its working fine, but when ever i changed fields in database i have to change in crystal report also

Is there any way to update crystal report dynamically.....?(it shoulld display newly added columns in database also, Is it possible????)

Thanks,
Aswath.

Couldnt you return the fields from the database giving them the names required by the XML.

E.G. if the xml was [A VERY IMAGINATIVE XML DOC]

<?xml version="1.0" encoding="utf-8" ?>
<library>
  <book id="1">
    <name>john</name>
    <author>alan thomas</author>
    <isbn>100928772552</isbn>
    <date>14/03/2007</date>
  </book>
</library>

and your SQL statement looked osmething like this

SELECT bookname, bookauthor, bookisbn, bookdate FROM book WHERE bookid = 1

You could name each returned value to that xml tag that it corresponds to E.G.

SELECT bookname AS name, bookauthor AS author, bookisbn AS isbn, bookdate AS date FROM book WHERE bookid = 1

i havent tried this myself but i rekon it would work for you if your then returning a dataset and binding this to the report.

Fungus1487 55 Posting Pro in Training

but if you have to use mysql then go the php route as it is integrated alot better into the php language.

Fungus1487 55 Posting Pro in Training

what does your code to varify the password look like? could we see a sample?

Fungus1487 55 Posting Pro in Training

1) create a web application
2) right click on the solution explorer root folder.
3) press "Add New Item"
4) select "Web User Control" and give it a name.
5) write your asp.net/html etc.
6) to use on a page drag and drop from solution explorer.

Fungus1487 55 Posting Pro in Training

OK ill give it a whirl and see what is happening. User wise it could be from 10 - 100 users at any one time.

Fungus1487 55 Posting Pro in Training

Hello All.

This seems like a simple question but i cannot find a solid answer anywhere.

Im in the middle of streamlining our web application for use on local network and external use.

When a form loads there are usually several blocks of code that run.

EG.
Fetch Title From Database
Fetch Items For Combo Lists To Populate
Fetch Saved Data To Insert Into Fields

NOW obviously there is some processing inbetween especially step 2 of filling combo lists which can contain anywhere between 1 - 1000 selections (not practical but it is the users choice if they want 1000)

I understand opening a connection to a database is a costly server action processing wise and also is time consuming. So is it better for me to maintain one connection to pass to these seperate methods on page load or open a new instance-return data-close connection inside each method.

cheers.

Fungus1487 55 Posting Pro in Training

do you have flash installed for internet explorer as firefox uses a seperate plugin to IE. Also use firefox. It is a faster browser!

Fungus1487 55 Posting Pro in Training

Hello All,

im looking to find the best technique to use for the following scenario i believe this is going to be best using application level variables.

Scenario:

I have a table in a database with roughly 100 rows (increasing constantly) they are all holding integers.

These rows all hold a global setting for the application i am developing for the web. These settings will affect all users.

These settings will not be changed often.

They are basically used as flags to decide appropriate actions set by admin E.G. export a report to PDF not WORD or vice versa.


I Believe the best way to achive what i am after is to add code to the global.asax file for ON STARTUP of the application to query the database for all these items and set them.

If modified through the admin section these could then be set directly.

Is this the best option for me to choose.

I will be holding 32bit Integers and the number of settings will increase. Will i have any performance issues/setybacks using this method? cheers.

Fungus1487 55 Posting Pro in Training

Ok managed to solve this one myself after a bit of staring at my screen for a long time. For anyone interested this worked for me...

SELECT portfolio.portfolioid FROM portfolio WHERE (NOT EXISTS (SELECT portfolioclient.* FROM portfolioclient WHERE (portfolio.portfolioid = portfolioclient.portfolioid) AND (portfolioclient.clientid = 1)))
Fungus1487 55 Posting Pro in Training
Select * from Table1 a left join Table2 b on (a.id = b.id) where a.id <> '1'

sorry this does not work.
It simply filters table A's records removing the one with an id of '1'.

its probably easier with a working example.

I have the following tables...

### 'portfolio' - table
'portfolioid' - int [primary key]
'usertitle' - string
'clienttitle' - string

### Records
1, "test title", "test title"
2, "test title 1", "test title a"
3, "test title 2", "test title b"
4, "test title 3", "test title c"

### 'portfolioclient' - table
'portfolioid' - int
'clientid' - int

### Records
1, 1
3, 1
2, 2
4, 2

i wish to return all portfolio records which are not attached to a 'clientid'. E.G. if a client has an ID of '1' then the portfolio records returned should be 2 and 4.

i thought this would work but obviosuly not.

SELECT portfolio.* FROM portfolio LEFT JOIN portfolioclient ON portfolio.portfolioid = portfolioclient.portfolioid WHERE portfolioclient.clientid <> 1
Fungus1487 55 Posting Pro in Training

Hello all,

hope i can get some help on this one as im not brilliant with my database scripts.

I have table "A" and table "B", table "A" contains information on a portfolio and table "B" is a joining table which connects this table to a user of the system with a 1-to-many relationship.


I am looking to return all records in table "A" that are not connected to a user in table "B"

i have tried this

SELECT a.* FROM a LEFT JOIN b ON a.id = b.id WHERE b.userid <> 1

but i know this is incorrect but cannot figure out myself how to achieve what i want.

Hopefully someone can point me in the right direction.

Fungus1487 55 Posting Pro in Training

There is a problem with your javascript code somewhere as "document.getElementById" is perfectly fine for obtaining a table element with an ID.

Fungus1487 55 Posting Pro in Training

you cannot nest a form within a form as set by w3c.

Fungus1487 55 Posting Pro in Training

Hello all,

i have googled around without any reference to what i am looking for (whether it can be done).

I wish to limit the amount of memory used at any one time per session I.e. for tasks that may require some time i dont want one user using up all the servers memory performing it. Can this be done in windows server 2003 with IIS 6.0 or is this an ASP.NET issue i should address in CODE

Fungus1487 55 Posting Pro in Training

hmm.. I would use confirm box too. But if you want to have custom buttons, thats the only way, a popup.

personally i would float a DIV over the center of the page with two buttons in. Faking a popup as i rekon this would achieve sameeffect without popups (probably cuz i hate popup windows :D). but hey it depends how much trouble you want to go into to making two buttons look different.

Fungus1487 55 Posting Pro in Training

what if popups are disabled ?
i suppose you could check if the window is opened after calling the popup script but i would stick with the javascript confirm option as it is likely to cause you less grief.

Fungus1487 55 Posting Pro in Training

cheers that is all i needed its simply for testing purposes when showing clients.

Fungus1487 55 Posting Pro in Training

hello all,

the company i am working for (quite a small company) are looking to host our web applications suite on our internal server running windows server 2003 and IIS 6 and allow external access to it.

We have a static IP from our ISP and currently can access the applications suite internally.

Am i right in thinking all that is nescessary for us to do to open this web application suite up to outside use is to port forward all http requests on port 80 to the internal servers IP Address from our router. and all requests to our static IP from the ISP would be forwarded to the server.

I am a complete server NEWB as it is and dont fancy cocking up something which i may have overlooked.

Anybodies help here is welcome.

regards.

Fungus1487 55 Posting Pro in Training

what was the issue? may help others if they ever get stuck with similiar problem

Fungus1487 55 Posting Pro in Training

control panel >> administrative tools >> iis >> help >> about internet information services

Fungus1487 55 Posting Pro in Training

hah
wat a noob i have found the answer cheers all

Fungus1487 55 Posting Pro in Training

Hello all,

i have recently finished work on a clients database.

they now wish for one field in the database to have 10% taken off for each record.
can this be performed soley through an SQL statement on the MYSQL database.

Fungus1487 55 Posting Pro in Training

Thing is... when it comes to footers.. They really should be at the bottom of your content and not the screen. Just think about it!? Would you continue reading even when there is no content?

Anyway, I kinda understand where you coming from (after viewing your site). So here is how I'd do it, using css:

<div align="center" style="position: absolute; bottom: 2px; left: 50%;">Copyright 2008 </div>

Make adjustments as you please.

If this solved your problem or pointed you in the right direction. Please add to my rep.
Macneato

this will not work as content that expands over more than one whole vertical page wont compensate for the extra height.

the footer will rewmain at the bottom of your screen until you scroll. Then it will stay at that position.

i suggest using

<div align="center" style="position: SCROLL; bottom: 2px; left: 50%;">Copyright 2008 </div>

the footer will sit at the very bottom of your page in all circumstances then.

Fungus1487 55 Posting Pro in Training

what version of IIS you running ?

Fungus1487 55 Posting Pro in Training

can we see some code?

Fungus1487 55 Posting Pro in Training

can you put some error listing up here ?

Fungus1487 55 Posting Pro in Training

you dont need str_replace inside str_replace etc etc.

use two arrays

$your_txt = "Hello 'WORLD'";
$txt = array("'", "\"");
$txt_replace = array("\'", "\\\"");
$x=str_replace($txt, $txt_replace, $your_txt);
echo $x;

this way you can have two arrays and no messy inner replacements inside replacements.

although nav33n may have shown you his way as at first it appears easier (both do the same trick).

Venom Rush commented: Nice variation from what was suggested +1
Fungus1487 55 Posting Pro in Training

yep.
that is the easiest way ive found to style in these situatuions

Fungus1487 55 Posting Pro in Training

i have recently finished a project for one group which owns four companys and i had the opposite. they wanted identical sites with minor differences.

answer is dont fight your customer/client do it their way or you doint get paid!

offer critisism where nescessary if you think it will work better one way or antoher

HazardTW commented: Thank you for taking the time to express your opinion and experience. +1
Fungus1487 55 Posting Pro in Training

in short
you cannot.
not to the extent some people like to change their form buttons.

best bet is to create another button with an onclick event to press the input type="file" which should be hidden.

Fungus1487 55 Posting Pro in Training

Duh, i'd figured that out allready... But using javascript print method means getting that ugly print dialog screen, which i don't want.

without this you are breaking standard conventions and may confuse users more.

Fungus1487 55 Posting Pro in Training

use ajax to capture a pages source then parse the page source using php or asp.net (this will work only if the page your capturing has valid markup or if you add lots of error handling)

Fungus1487 55 Posting Pro in Training

I don't see that either.

I have FF 2.0.0.11 too.

we both have clever computers :D

Fungus1487 55 Posting Pro in Training

that must mean my computer is cleverer than everyones :D

see attached photo

(yes this is on page load without pressing anything or focusing.

Fungus1487 55 Posting Pro in Training

its easier to develop for firefox then adapt to IE than vice versa. although there is a memory leak in firefox which results in memory build up, only noticeable if left open a very very long time.

Fungus1487 55 Posting Pro in Training

mine does not show this white line in firefox version 2.0.0.11

Fungus1487 55 Posting Pro in Training

no problem at all you can mark the post as solved if you like :D

Fungus1487 55 Posting Pro in Training

its is because the bar is positioned absolutely.

and when you set a width of 100% it is 100% of the viewable area so when your content is larger than your browser it exceeds 100%.


dont position it absolutley. this is bad.

perhaps use a table layout for the top ?

Fungus1487 55 Posting Pro in Training

you need to post this in the javascript forum

Fungus1487 55 Posting Pro in Training

i dont beleive you can upload a directory at all in php.

they could upload a zip file then use php to break apart the file and then create the directorys/file structure in this.

Fungus1487 55 Posting Pro in Training

maybe it would be wiser to ask in the javascript forum