Showing posts with label stupid. Show all posts
Showing posts with label stupid. Show all posts

Thursday, March 29, 2012

newbie - stupid install question

Hi,

i FPTed my files to my host ISP. Now i can browse to
www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
Forbidden" at www.mysite.com. How do i get www.mysite.com to display
WebForm1.aspx?

Thanks,
MarkIn addition to index.html, your host will look for default.aspx (presuming it
supports asp.net, which is not the case with many hosters). The search order
depends on how IIS is configured (in IIS you can specify which pages to use
as the default, and in which order it looks for them, but your hoster likely
won't let you get at this).

So, get rid of index.html and rename your web form to default.aspx. Or, make
default.aspx or index.html a list of links to your real pages. Or, navigate
directly to mysite.com/webform1.aspx.

Bill

"Mark Oliver" wrote:

> Hi,
> i FPTed my files to my host ISP. Now i can browse to
> www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
> at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
> Forbidden" at www.mysite.com. How do i get www.mysite.com to display
> WebForm1.aspx?
> Thanks,
> Mark
>
>
There is a setting in IIS for a defualt document. The file can by anything
including WebForm1.aspx. Your host should have a control panel where you can
control this option. There is a default asp.net file with IIS, it is
default.aspx. I suggest you use this instead of WebForm1.aspx. It will make
moving your project to different servers easier.

HTH MikeL

"Mark Oliver" wrote:

> Hi,
> i FPTed my files to my host ISP. Now i can browse to
> www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
> at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
> Forbidden" at www.mysite.com. How do i get www.mysite.com to display
> WebForm1.aspx?
> Thanks,
> Mark
>
>
renaming to index.aspx works great!
Thanks Bill and MikeL
Mark

"Mark Oliver" <camarkco@.hotmail.com> wrote in message
news:8bCdnaLdHKKcAQLcRVn-gg@.adelphia.com...
> Hi,
> i FPTed my files to my host ISP. Now i can browse to
> www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
> at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
> Forbidden" at www.mysite.com. How do i get www.mysite.com to display
> WebForm1.aspx?
> Thanks,
> Mark

newbie - stupid install question

Hi,
i FPTed my files to my host ISP. Now i can browse to
www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
Forbidden" at www.mysite.com. How do i get www.mysite.com to display
WebForm1.aspx?
Thanks,
MarkIn addition to index.html, your host will look for default.aspx (presuming i
t
supports asp.net, which is not the case with many hosters). The search order
depends on how IIS is configured (in IIS you can specify which pages to use
as the default, and in which order it looks for them, but your hoster likely
won't let you get at this).
So, get rid of index.html and rename your web form to default.aspx. Or, make
default.aspx or index.html a list of links to your real pages. Or, navigate
directly to mysite.com/webform1.aspx.
Bill
"Mark Oliver" wrote:

> Hi,
> i FPTed my files to my host ISP. Now i can browse to
> www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
> at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
> Forbidden" at www.mysite.com. How do i get www.mysite.com to display
> WebForm1.aspx?
> Thanks,
> Mark
>
>
There is a setting in IIS for a defualt document. The file can by anything
including WebForm1.aspx. Your host should have a control panel where you ca
n
control this option. There is a default asp.net file with IIS, it is
default.aspx. I suggest you use this instead of WebForm1.aspx. It will mak
e
moving your project to different servers easier.
HTH MikeL
"Mark Oliver" wrote:

> Hi,
> i FPTed my files to my host ISP. Now i can browse to
> www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
> at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
> Forbidden" at www.mysite.com. How do i get www.mysite.com to display
> WebForm1.aspx?
> Thanks,
> Mark
>
>
renaming to index.aspx works great!
Thanks Bill and MikeL
Mark
"Mark Oliver" <camarkco@.hotmail.com> wrote in message
news:8bCdnaLdHKKcAQLcRVn-gg@.adelphia.com...
> Hi,
> i FPTed my files to my host ISP. Now i can browse to
> www.mysite.com/WebForm1.aspx. The problem is that my ISP runs index.html
> at www.mysite.com. If i delete index.html i get "HTTP Error 403 -
> Forbidden" at www.mysite.com. How do i get www.mysite.com to display
> WebForm1.aspx?
> Thanks,
> Mark
>
>

Monday, March 26, 2012

newbie configuration-type issue

All right, there's something stupid I'm missing.
I have a folder named CPR with a subfolder, V2. I built a small website in
a solution in CPR, dropped in on the webserver (third-party hosted) and it
runs. I've lately been working on a replacement version in the V2
subfolder, which is in a separate solution.
When I run v2's version from the development machine, it runs fine. When I
drop it on the Web server and try to run it or copy everything over to
another development machine and try to run it in VS, I receive the error:
Could not load type 'CPRInc.WebForm1'.
and points to my Page directive:
<%@dotnet.itags.org. Page language="c#" Codebehind="CPRTemplate.aspx.cs"
AutoEventWireup="false" Inherits="CPR.WebForm1" %>
This feels like a configuration problem like one box uses relative pathing
while the others don's SORT of thing. Any ideas?
TIA,
JohnOn your machine that folder is probably setup as a virtual=
directory where on the webserver it is probably not. The=
virtual directory can have a seperate bin directory which is=
used by .Net to store the DLL's that your files are referencing.=
To make it work you can either create the folder as a vitual=
directory (i.e., Application) or just add the DLL's that the V2=
application uses to the Bin directory of the root folder.
Alan Washington

> All right, there's something stupid I'm missing.
> I have a folder named CPR with a subfolder, V2. I built a=
small website in
> a solution in CPR, dropped in on the webserver (third-party=
hosted) and it
> runs. I've lately been working on a replacement version in the=
V2
> subfolder, which is in a separate solution.
> When I run v2's version from the development machine, it runs=
fine. When I
> drop it on the Web server and try to run it or copy everything=
over to
> another development machine and try to run it in VS, I receive=
the error:
> Could not load type 'CPRInc.WebForm1'.
> and points to my Page directive:
> <%@. Page language=3D"c#" Codebehind=3D"CPRTemplate.aspx.cs"
> AutoEventWireup=3D"false" Inherits=3D"CPR.WebForm1" %>
> This feels like a configuration problem like one box uses=
relative pathing
> while the others don's SORT of thing. Any ideas?
> TIA,
> John
>
User submitted from AEWNET (http://www.aewnet.com/)

newbie configuration-type issue

All right, there's something stupid I'm missing.

I have a folder named CPR with a subfolder, V2. I built a small website in
a solution in CPR, dropped in on the webserver (third-party hosted) and it
runs. I've lately been working on a replacement version in the V2
subfolder, which is in a separate solution.

When I run v2's version from the development machine, it runs fine. When I
drop it on the Web server and try to run it or copy everything over to
another development machine and try to run it in VS, I receive the error:

Could not load type 'CPRInc.WebForm1'.

and points to my Page directive:

<%@dotnet.itags.org. Page language="c#" Codebehind="CPRTemplate.aspx.cs"
AutoEventWireup="false" Inherits="CPR.WebForm1" %
This feels like a configuration problem like one box uses relative pathing
while the others don's SORT of thing. Any ideas?

TIA,

JohnOn your machine that folder is probably setup as a virtualdirectory where on the webserver it is probably not. Thevirtual directory can have a seperate bin directory which isused by .Net to store the DLL's that your files are referencing.To make it work you can either create the folder as a vitualdirectory (i.e., Application) or just add the DLL's that the V2application uses to the Bin directory of the root folder.

Alan Washington

> All right, there's something stupid I'm missing.
> I have a folder named CPR with a subfolder, V2. I built asmall website in
> a solution in CPR, dropped in on the webserver (third-partyhosted) and it
> runs. I've lately been working on a replacement version in theV2
> subfolder, which is in a separate solution.
> When I run v2's version from the development machine, it runsfine. When I
> drop it on the Web server and try to run it or copy everythingover to
> another development machine and try to run it in VS, I receivethe error:
> Could not load type 'CPRInc.WebForm1'.
> and points to my Page directive:
> <%@. Page language="c#" Codebehind="CPRTemplate.aspx.cs"
> AutoEventWireup="false" Inherits="CPR.WebForm1" %>
> This feels like a configuration problem like one box usesrelative pathing
> while the others don's SORT of thing. Any ideas?
> TIA,
> John
>
User submitted from AEWNET (http://www.aewnet.com/)

Newbie DataTable question

Stupid question for the day,

Just playing around with rewriting my website in .Net, I want to add a
record to my database table, in the old ADO, it was simple you could
create a connection and recordset and then rs.AddNew etc... in .Net it
seems they recommend that you populate a DataTable then use the
NewRow method

Isnt this bringing back a entire copy of the table (in this case 40,000
users), if so isn't this very inefficient? I know you can run a
insert via a ExecuteNonQuery which is the way I have done it in the
past (usually passing parameters to stored procs)

But I would have thought you should be able to add a row (Datarow) in
this case to a table without returning the entire table when you
connect to it.

Probably being very stupid

heres my code

try
{
// Initializations
string database = "MyDB.mdb";
string connectionString =
@dotnet.itags.org."Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\Web\Database\" +
database;

//connection
OleDbConnection cnn = new OleDbConnection();
cnn.ConnectionString = connectionString;
cnn.Open();

OleDbCommand com = cnn.CreateCommand();
com.CommandText = "Select * from tblUser";

OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = com;

//DataSet ds = new DataSet();
//da.Fill(ds, "Users");

DataTable dt = new DataTable();
da.Fill(dt);

//DataRow dr = dt.Rows[0];
DataRow dr = dt.NewRow();

dr["FirstName"] = FirstName.ToString();
dr["Surname"] = Surname.ToString();
dr["Email"] = Email.ToString();

dt.Rows.Add(dr);
da.Update(dt);

//close up

cnn.Close();
}
catch (OleDbException ee)
{
Console.WriteLine(ee.ToString());
}the notion of in-memory datasets, is you only keep a copy of what you need.
the premise is that normally you only need a subset of the data. a dataset
keeps track of the status of a row (new, modified,deleted,unchanged). then
the adapter can look at the row status to determine whether to insert,
delete, update, or do nothing.

in your case you are loading the dataset solely to get the structure. you
could use the folowwing statement.

com.CommandText = "Select * from tblUser where 1 = 0";

which would only return column info and no data. a better approach is to use
typed datasets. here you use a wizard to build a dataset class that initials
the table and column info. this removes the requirement to do a dummy
database select. also you get a dot notion for accessing column data.

-- bruce (sqlwork.com)

"Ben" <BenScott@.aemail4u.com> wrote in message
news:1151423636.132121.107680@.75g2000cwc.googlegro ups.com...
> Stupid question for the day,
>
> Just playing around with rewriting my website in .Net, I want to add a
> record to my database table, in the old ADO, it was simple you could
> create a connection and recordset and then rs.AddNew etc... in .Net it
> seems they recommend that you populate a DataTable then use the
> NewRow method
>
> Isnt this bringing back a entire copy of the table (in this case 40,000
> users), if so isn't this very inefficient? I know you can run a
> insert via a ExecuteNonQuery which is the way I have done it in the
> past (usually passing parameters to stored procs)
>
> But I would have thought you should be able to add a row (Datarow) in
> this case to a table without returning the entire table when you
> connect to it.
>
> Probably being very stupid
> heres my code
> try
> {
> // Initializations
> string database = "MyDB.mdb";
> string connectionString =
> @."Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\Web\Database\" +
> database;
> //connection
> OleDbConnection cnn = new OleDbConnection();
> cnn.ConnectionString = connectionString;
> cnn.Open();
> OleDbCommand com = cnn.CreateCommand();
> com.CommandText = "Select * from tblUser";
> OleDbDataAdapter da = new OleDbDataAdapter();
> da.SelectCommand = com;
> //DataSet ds = new DataSet();
> //da.Fill(ds, "Users");
> DataTable dt = new DataTable();
> da.Fill(dt);
> //DataRow dr = dt.Rows[0];
> DataRow dr = dt.NewRow();
> dr["FirstName"] = FirstName.ToString();
> dr["Surname"] = Surname.ToString();
> dr["Email"] = Email.ToString();
> dt.Rows.Add(dr);
> da.Update(dt);
> //close up
> cnn.Close();
> }
> catch (OleDbException ee)
> {
> Console.WriteLine(ee.ToString());
> }
thanks Bruce,

yeah as you where writing i had tried that, bit quicker, but then it
wont allow me to insert data

"Update requires a valid InsertCommand when passed DataRow collection
with new rows."

so i guess i need to change

da.SelectCommand = com;

to

da.InsertCommand = com;

that doesnt work :(. any more words of wisdom? the main reason i am
doing this is to avoid having to handle what data is being put into
each field when the users submit the data. creating a Insert string
seem to me the wrong way to do this.

Newbie DataTable question

Stupid question for the day,
Just playing around with rewriting my website in .Net, I want to add a
record to my database table, in the old ADO, it was simple you could
create a connection and recordset and then rs.AddNew etc... in .Net it
seems they recommend that you populate a DataTable then use the
NewRow method
Isnt this bringing back a entire copy of the table (in this case 40,000
users), if so isn't this very inefficient? I know you can run a
insert via a ExecuteNonQuery which is the way I have done it in the
past (usually passing parameters to stored procs)
But I would have thought you should be able to add a row (Datarow) in
this case to a table without returning the entire table when you
connect to it.
Probably being very stupid
heres my code
try
{
// Initializations
string database = "MyDB.mdb";
string connectionString =
@dotnet.itags.org."Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\Web\Database\" +
database;
//connection
OleDbConnection cnn = new OleDbConnection();
cnn.ConnectionString = connectionString;
cnn.Open();
OleDbCommand com = cnn.CreateCommand();
com.CommandText = "Select * from tblUser";
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = com;
//DataSet ds = new DataSet();
//da.Fill(ds, "Users");
DataTable dt = new DataTable();
da.Fill(dt);
//DataRow dr = dt.Rows[0];
DataRow dr = dt.NewRow();
dr["FirstName"] = FirstName.ToString();
dr["Surname"] = Surname.ToString();
dr["Email"] = Email.ToString();
dt.Rows.Add(dr);
da.Update(dt);
//close up
cnn.Close();
}
catch (OleDbException ee)
{
Console.WriteLine(ee.ToString());
}the notion of in-memory datasets, is you only keep a copy of what you need.
the premise is that normally you only need a subset of the data. a dataset
keeps track of the status of a row (new, modified,deleted,unchanged). then
the adapter can look at the row status to determine whether to insert,
delete, update, or do nothing.
in your case you are loading the dataset solely to get the structure. you
could use the folowwing statement.
com.CommandText = "Select * from tblUser where 1 = 0";
which would only return column info and no data. a better approach is to use
typed datasets. here you use a wizard to build a dataset class that initials
the table and column info. this removes the requirement to do a dummy
database select. also you get a dot notion for accessing column data.
-- bruce (sqlwork.com)
"Ben" <BenScott@.aemail4u.com> wrote in message
news:1151423636.132121.107680@.75g2000cwc.googlegroups.com...
> Stupid question for the day,
>
> Just playing around with rewriting my website in .Net, I want to add a
> record to my database table, in the old ADO, it was simple you could
> create a connection and recordset and then rs.AddNew etc... in .Net it
> seems they recommend that you populate a DataTable then use the
> NewRow method
>
> Isnt this bringing back a entire copy of the table (in this case 40,000
> users), if so isn't this very inefficient? I know you can run a
> insert via a ExecuteNonQuery which is the way I have done it in the
> past (usually passing parameters to stored procs)
>
> But I would have thought you should be able to add a row (Datarow) in
> this case to a table without returning the entire table when you
> connect to it.
>
> Probably being very stupid
> heres my code
> try
> {
> // Initializations
> string database = "MyDB.mdb";
> string connectionString =
> @."Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\Web\Database\" +
> database;
> //connection
> OleDbConnection cnn = new OleDbConnection();
> cnn.ConnectionString = connectionString;
> cnn.Open();
> OleDbCommand com = cnn.CreateCommand();
> com.CommandText = "Select * from tblUser";
> OleDbDataAdapter da = new OleDbDataAdapter();
> da.SelectCommand = com;
> //DataSet ds = new DataSet();
> //da.Fill(ds, "Users");
> DataTable dt = new DataTable();
> da.Fill(dt);
> //DataRow dr = dt.Rows[0];
> DataRow dr = dt.NewRow();
> dr["FirstName"] = FirstName.ToString();
> dr["Surname"] = Surname.ToString();
> dr["Email"] = Email.ToString();
> dt.Rows.Add(dr);
> da.Update(dt);
> //close up
> cnn.Close();
> }
> catch (OleDbException ee)
> {
> Console.WriteLine(ee.ToString());
> }
>
thanks Bruce,
yeah as you where writing i had tried that, bit quicker, but then it
wont allow me to insert data
"Update requires a valid InsertCommand when passed DataRow collection
with new rows."
so i guess i need to change
da.SelectCommand = com;
to
da.InsertCommand = com;
that doesnt work :(. any more words of wisdom? the main reason i am
doing this is to avoid having to handle what data is being put into
each field when the users submit the data. creating a Insert string
seem to me the wrong way to do this.