shibbard 0 Newbie Poster

Most basic way would be to give them your external IP address and forward port 80 (http) to your webserver. Open firewall for port 80 for their IP addresses only and give them a URL like <your ip>/somewebpage.aspx. Unless you register a domain name for your external IP.

shibbard 0 Newbie Poster

Where it uses:

Label1.Text += li.Text + "<br />";

Instead use:

Label1.Text += li.Value + "<br />";

shibbard 0 Newbie Poster

Querystring is always useful if you want the user to be able to return to such a page directly, or bookmark it.

The only other consideration is security - remember that querystrings can be modified by the user.

There are a whole bunch of ways to pass values, see here:

http://msdn.microsoft.com/en-gb/magazine/cc300437.aspx

shibbard 0 Newbie Poster

All you are storing in the DB is the string. It will only have newlines in the DB column if you insert newline characters (vbCrLf, vbNewLine are used in Access).

So if you hit return in the textbox to create a new line I think you will see '/n'. Find these, replace them with vbCrLf or vbNewLine and this should retain the newlines into the DB.

shibbard 0 Newbie Poster

I find the solution - see the select:

declare @t table 
(DBID           int
,Title          varchar(10)
,ParentID       int
,OrderNum       int
)

insert @t
      select 1,'aaa',0,1
union select 2,'bbb',0,2
union select 3,'ccc',1,1
union select 4,'ddd',1,2
union select 5,'eee',2,1

select * 
from @t
order by ISNULL(NULLIF(ParentID,0),DBID)
        ,ParentID
        ,OrderNum
        ,DBID
shibbard 0 Newbie Poster

Hi all,

I have a single table with both parent and child nodes, and each has an order number in it.

I am trying to write a single query to output them in order, its for a navigation list with categories and sub-categories.

I could manage it in code rather than in the SQL query but it would involve calling a query from within a query loop - which I want to avoid.

Table:

DBID | Title | ParentID | OrderNum
 1      aaa       0          1
 2      bbb       0          2
 3      ccc       1          1
 4      ddd       1          2
 5      eee       2          1

and I want to get a result set like:

DBID | Title | ParentID | OrderNum
 1      aaa       0          1      <<< main 
 3      ccc       1          1      <<< child
 4      ddd       1          2      <<< 2nd child
 2      bbb       0          1      <<< main 
 5      eee       2          1      <<< child

I have been looking at using a recursive SQL select or Common Table Expressions (CTE) but have not been able to figure it out yet.

Can anyone help point me in the right direction?

(Using SQL Server 2005 / ASP.Net C#)

shibbard 0 Newbie Poster

Ok then just have a number column (e.g. ID) - with it set as Identity Insert on (see http://www.w3schools.com/Sql/sql_autoincrement.asp) or just use SQL server manager to set it.

Then use ORDER BY ID Desc. Last record will be first and sorted in the order that rows where added.

shibbard 0 Newbie Poster

Set the checkboxlist to postback to an event handler when the selectedindex changes and update some store or DB table.

Example use here -> http://asp-net-example.blogspot.com/2009/03/how-to-use-autopostback-feature-in.html

shibbard 0 Newbie Poster

Put them in a <div> or <span> and set the class or in line style?

<div style="font-weight: bold"> text </div>

and use the same method to get the indent

<div style="text-indent:10px"> text </div>

or use padding.

shibbard 0 Newbie Poster

Can you just use 'ORDER BY <column> DESC' in your query?

http://www.tizag.com/sqlTutorial/sqlorderby.php

shibbard 0 Newbie Poster

Websites are great to help as you progress but I don't think you can beat a good book which you can have sit next to you and start with some of the basic exercises.

Also when you have a bit of downtime just reading through some parts can be really helpful for when you go back to the computer.

I started ASP.Net in this way, chose to program in C# but VB.Net is also an option.

This is the book I started with and it served me well. There are plenty out there, read some reviews, find a good one and just start with some basic sites to get going.

http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470042583.html

When you get stuck forums and google are a god send :)

Good luck.

shibbard 0 Newbie Poster

You never opened the connection (objConnection)

Glad you fixed it it anyway ;)

shibbard 0 Newbie Poster

Post your code so we can see what the problem is.

shibbard 0 Newbie Poster

Code looks ok, is the checkboxlist inside another control - i.e. a gridview or detailsview or something?

shibbard 0 Newbie Poster

Can you post you code with the button and the event handler function?

Are you sure you don't have an infinite loop somewhere - this can bring down your local server which will then show you a 'page cannot be reached' error.

shibbard 0 Newbie Poster

I don't have the answer but can maybe help to point you in the right direction.

What you are looking for is a lossless image compression (so that no quality at all is lost). I don't think it would be possible to ahceive the reduction in file size you are looking for using lossless.

Lossy may get you closer but some amount of quality may be lost (even if hardly visible). Also this will depend on the format your files are already in - jpeg is already compressed (and generally lossy).

This may help - http://en.wikipedia.org/wiki/Graphics_file_formats

shibbard 0 Newbie Poster

Use this in your event handler for clicking an upload button.

if (FileUpLoad1.HasFile)
{
    String fileName = "yourfilename";
    FileUpload1.PostedFile.SaveAs(Server.MapPath("yourpath/") + fileName);
}