Monday, March 26, 2012
newbie asp/ado.net question.
I am very new to .net but not new to asp or ado.
I am just wondering the best way to do the following...
I have a database which stores a list of messages/threads (like google
newsgroups threads). I want to display these on a webpage where each message
is a hyperlink, and each message has a treeview drill-down mechanism where
you can see replies for a particular message (just like in outlook express
newsgroups).
i have an aspx page which i want to display the data and an object which
should do all the retrieving/updating of data.
what is the best way to do this (in terms of using datareader, dataset,
etc). and where would be the logical place to dim these objects (asp or
object)?
one more thing... i would like to return the data from the object in XML
(unless .net has a newer easier way in presenting such information!)
thanks.One of the great things about .NET is the fact that there are tons of ways
to accomplish the same task, so I'm sure you will get tons of answers. ;-)
That being said, if all you want to do, is format the equivalent of a
forward-looking ado recordset, then I would just databind a DataReader to a
DataList or Repeater.
However, if you want to go with XML, I would bring back a dataset, and then
use the WriteXML() method.
hth,
Dave
www.aspNetEmail.com
"linz" <linz@.nospam.com> wrote in message
news:uy8yVwZQDHA.2480@.tk2msftngp13.phx.gbl...
> Hi,
> I am very new to .net but not new to asp or ado.
> I am just wondering the best way to do the following...
> I have a database which stores a list of messages/threads (like google
> newsgroups threads). I want to display these on a webpage where each
message
> is a hyperlink, and each message has a treeview drill-down mechanism where
> you can see replies for a particular message (just like in outlook express
> newsgroups).
> i have an aspx page which i want to display the data and an object which
> should do all the retrieving/updating of data.
> what is the best way to do this (in terms of using datareader, dataset,
> etc). and where would be the logical place to dim these objects (asp or
> object)?
> one more thing... i would like to return the data from the object in XML
> (unless .net has a newer easier way in presenting such information!)
> thanks.
hmm... kinda hard to answer, because I don't know enough about your app.
You wanted XML, I was just making you aware there is a WriteXML() method on
the DataSet, that's all.
If you can, I would return all the data at once, as much as makes sense.
Database connections are relatively expensive, so I would try to minimize
them to a certain extent.
I don't understand what you mean about scope, as the architecture of the web
as stayed the same (still stateless), just the way we are designing apps has
changed 1000%.
You may want to try a different ideas, and ask about more opinions.
hth,
Dave
www.aspNetEmail.com
"phillipa" <phillipa@.nospamming.com> wrote in message
news:urfF0SaQDHA.4024@.tk2msftngp13.phx.gbl...
> thanks, so do you mean dim a dataset in my object and use it to return xml
> back to the aspx page.?
> what about scope? does it work in the same way as classic asp? (ie:
> everytime a user clicks on a message, should i be recreating a connection
to
> the database in my object and populating the message data into a dataset
> then writing the xml back to the aspx page?)
> this is the bit i am unclear about.
>
> "dave wanta" <nospam@.nospam.com> wrote in message
> news:%23r09syZQDHA.2460@.TK2MSFTNGP10.phx.gbl...
> > One of the great things about .NET is the fact that there are tons of
ways
> > to accomplish the same task, so I'm sure you will get tons of answers.
;-)
> > That being said, if all you want to do, is format the equivalent of a
> > forward-looking ado recordset, then I would just databind a DataReader
to
> a
> > DataList or Repeater.
> > However, if you want to go with XML, I would bring back a dataset, and
> then
> > use the WriteXML() method.
> > hth,
> > Dave
> > www.aspNetEmail.com
> > "linz" <linz@.nospam.com> wrote in message
> > news:uy8yVwZQDHA.2480@.tk2msftngp13.phx.gbl...
> > > > Hi,
> > > > I am very new to .net but not new to asp or ado.
> > > > I am just wondering the best way to do the following...
> > > > I have a database which stores a list of messages/threads (like google
> > > newsgroups threads). I want to display these on a webpage where each
> > message
> > > is a hyperlink, and each message has a treeview drill-down mechanism
> where
> > > you can see replies for a particular message (just like in outlook
> express
> > > newsgroups).
> > > > i have an aspx page which i want to display the data and an object
which
> > > should do all the retrieving/updating of data.
> > > > what is the best way to do this (in terms of using datareader,
dataset,
> > > etc). and where would be the logical place to dim these objects (asp
or
> > > object)?
> > > > one more thing... i would like to return the data from the object in
XML
> > > (unless .net has a newer easier way in presenting such information!)
> > > > thanks.
> >
Saturday, March 24, 2012
Newbie having problems with a server error
"Object reference not set to an instance of an object."
I understand the error but can't see why it's happening. The line it refers to is:
<%Response.Write(Validate.setColour(errorcode[0]));%
The 'Validate' object is an instance of the following class:
using System;namespace _4Touristweb
{
/// <summary>
/// Summary description for validate.
/// </summary>
public class validate
{
private string outputString;public validate()
{
//
// TODO: Add constructor logic here
//
}public string setColour(bool errorcode)
{
if (errorcode)
//set colour to red
outputString = "<DIV style=\"color:"+"#FF0000"+";\">";
else
//set colour to black
outputString = "<DIV style=\"color:"+"#000000"+";\">";return outputString;
}
}
}
And in the HTML file I have this at the top, which creates the instance of the class.
<%@dotnet.itags.org. Page language="c#" Codebehind="reg2.aspx.cs" AutoEventWireup="false" Inherits="_4Touristweb.WebForm1" %>
<script runat="server" language="C#">
public bool[] errorcode;
public _4Touristweb.validate Validate = new _4Touristweb.validate();
public string businessName;
public string address;
public string district;
public string town;
public string postcode;
public string telephone;
public string fax;
public string county;
public string email;
public string contactName;
public bool terms;
</script
I'm afraid I haven't a clue why the error is coming up.Hi,
In this line <%Response.Write(Validate.setColour(errorcode[0]));%
What is the errorcode[0] value. Seems like there is no value to send to the Validate.setColour() Method.
Thanks for that 'heads up'. I forgot to create an instance of the boolean array in the declarations in the start.
Been a few years since I last did any serious OOP and it's showing.
Newbie help! importing custom namespaces in IIS
//test.cs
using System;
namespace tester{
public class testclass {
public String myString;
public void setMystring(){
myString = "hello world";
}
public String getString(){
return myString;
}
}
}
You help would be appreciated!
Thanks
abzI assume you aren't using Visual Studio .NET
You answered your own questions:
compile the cs file:
cs /t:library testclass.cs
and put it in your application's bin directory.
Newbie help!
I am reading a book on ASP.NET and the following code is from the book
(Teach Yourself ASP.NET in 21 Days by Chris Payne). I have typed the
code in notepad and I am having a problem with it that I hope someone
can help. Basically there is a Submit button which is supposed to
update an Access database, but for some reason it keeps on erroring
out. I have it in a try-catch block and I cannot get the update or
delete to work without error. The following is the code from the book.
Thank you in advance for your help!!!
<%@dotnet.itags.org. Page language="VB" %>
<%@dotnet.itags.org. import namespace="system.data" %>
<%@dotnet.itags.org. import namespace="system.data.oledb" %
<script runat="server">
'declare connection
dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;
Data source=C:\Inetpub\wwwroot\Day8\banking.mdb")
sub page_load(sender as object, e as eventargs)
if not page.ispostback then
FillDataGrid()
end if
end sub
sub submit(sender as object, e as eventargs)
'insert new data
dim i, j as integer
dim params(7) as string
dim strText as string
dim blnGo as boolean = true
j = 0
for i = 0 to addpanel.controls.count - 1
if addpanel.controls(i).gettype is gettype(textbox) then
strtext = ctype(addpanel.controls(i),textbox).text
if strtext <> "" then
params(j) = strtext
else
blngo = false
lblmessage.text = lblmessage.text & "You forgot to add a
value for " & addpanel.controls(i).id & "<p>"
lblmessage.style("Forecolor") = "red"
end if
j = j + 1
end if
next i
if not blngo then
exit sub
end if
dim strsql as string = "INSERT INTO Users (FirstName, LastName,
Address, City, State, Zip, Phone) VALUES (" & _
"'" & params(0) & "'," & _
"'" & params(1) & "'," & _
"'" & params(2) & "'," & _
"'" & params(3) & "'," & _
"'" & params(4) & "'," & _
"'" & params(5) & "'," & _
"'" & params(6) & "')"
executestatement(strsql)
filldatagrid()
end sub
sub dgData_Edit(sender as object, e as datagridcommandeventargs)
filldatagrid(e.item.itemindex)
end sub
sub dgdata_delete(sender as object, e as datagridcommandeventargs)
dim strsql = "DELETE FROM Users WHERE ID = " & e.item.itemindex
executestatement(strsql)
filldatagrid()
end sub
sub dgdata_update(sender as object, e as datagridcommandeventargs)
if updatedatastore(e) then
filldatagrid(-1)
end if
end sub
sub dgdata_cancel(sender as object, e as datagridcommandeventargs)
filldatagrid(-1)
end sub
sub dgdata_pageindexchanged(sender as object, e as
datagridpagechangedeventargs)
dgdata.databind()
end sub
function updatedatastore(e as datagridcommandeventargs) as boolean
dim i,j as integer
dim params(7) as string
dim strtext as string
dim blnGo as boolean = true
j = 0
for i = 1 to e.item.cells.count - 3
strtext = ctype(e.item.cells(i).controls(0),textbox).text
if strtext <> "" then
params(j) = strtext
else
blngo = false
lblmessage.text = lblmessage.text & "You forgot to enter a
value <p>"
end if
next i
if not blngo then
return false
exit function
end if
dim strsql as string = "UPDATE Users SET " & _
"FirstName = '" & params(0) & "'," & _
"LastName = '" & params(1) & "'," & _
"Address = '" & params(2) & "'," & _
"City = '" & params(3) & "'," & _
"State = '" & params(4) & "'," & _
"Zip = '" & params(5) & "'," & _
"Phone = '" & params(6) & "' " & _
"WHERE ID = " &
ctype(e.item.cells(0).controls(1),label).text
executestatement(strsql)
return blngo
end function
sub filldatagrid(optional editindex as integer = -1)
'open connection
dim objcmd as new oledbcommand("select * from Users", conn)
dim objreader as oledbdatareader
try
objcmd.connection.open()
objreader = objcmd.executereader()
catch ex as exception
lblMessage.text = "Error retrieving from the database"
end try
dgdata.datasource = objreader
if not editindex.equals(nothing) then
dgdata.edititemindex = editindex
end if
dgdata.databind()
objreader.close
objcmd.connection.close()
end sub
function executestatement(strsql as string)
'open connection
dim objcmd as new oledbcommand(strsql, conn)
try
objcmd.connection.open()
objcmd.executenonquery()
catch ex as exception
lblMessage.text = "Error updating the database"
end try
objcmd.connection.close()
end function
</script
<html><body>
<asp:Label id="lblMessage" runat="server"/
<form runat="server">
<asp:Datagrid id="dgData" runat="server"
BorderColor="Black" gridlines="vertical"
cellpadding="4" cellspacing="0" width="100%"
autogeneratecolumns="false"
ondeletecommand="dgData_Delete"
onEditcommand="dgData_Edit"
onCancelcommand="dgData_Cancel"
onUpdatecommand="dgData_Update"
onpageindexchanged="dgData_PageIndexChanged"
<columns>
<asp:TemplateColumn headertext="ID">
<itemtemplate>
<asp:Label id="Name" text='<%#
container.dataitem("ID") %>' runat="server"/>
</itemtemplate>
</asp:templatecolumn
<asp:boundcolumn headertext="First Name"
datafield="FirstName"/>
<asp:boundcolumn headertext="Last Name"
datafield="LastName"/>
<asp:boundcolumn headertext="Address" datafield="Address"/>
<asp:boundcolumn headertext="City" datafield="City"/>
<asp:boundcolumn headertext="State" datafield="State"/>
<asp:boundcolumn headertext="Zip" datafield="Zip"/>
<asp:boundcolumn headertext="Phone" datafield="Phone"/
<asp:editcommandcolumn edittext="Edit" canceltext="Cancel"
updatetext="Update" headertext="Edit"/>
<asp:buttoncolumn headertext="" text="Delete"
commandname="Delete"/>
</columns>
</asp:datagrid><p
<asp:panel id="AddPanel" runat="server">
<table>
<tr>
<td width="100" valign="top">First and last name: </td>
<td width="300" valign="top">
<asp:textbox id="tbFName" runat="server"/>
<asp:textbox id="tbLName" runat="server"/>
</td>
</tr
<tr>
<td width="100" valign="top">Address: </td>
<td width="300" valign="top">
<asp:textbox id="tbAddress" runat="server"/>
</td>
</tr
<tr>
<td width="100" valign="top">City, State, Zip: </td>
<td width="300" valign="top">
<asp:textbox id="tbCity" runat="server"/>,
<asp:textbox id="tbState" size=2
runat="server"/>
<asp:textbox id="tbZip" size=5 runat="server"/>
</td>
</tr
<tr>
<td width="100" valign="top">Phone: </td>
<td width="300" valign="top">
<asp:textbox id="tbPhone" size=11 runat="server"/>
</td>
</tr
<tr>
<td colspan=2 valign="top" align="right">
<asp:Button id="btSubmit" text="Add" onclick="Submit"
runat="server"/>
</td>
</tr>
</table>
</asp:panel>
</form>
</body></htmlTwo things. !
1.) Go and buy visual studio, you really wont go far using notepad (
Although you can get by without it, it will be a nightmare )
2.) You dont say what the error is.?
--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
<MPotok@.gmail.com> wrote in message
news:1145338918.804159.312510@.v46g2000cwv.googlegr oups.com...
> Hi,
> I am reading a book on ASP.NET and the following code is from the book
> (Teach Yourself ASP.NET in 21 Days by Chris Payne). I have typed the
> code in notepad and I am having a problem with it that I hope someone
> can help. Basically there is a Submit button which is supposed to
> update an Access database, but for some reason it keeps on erroring
> out. I have it in a try-catch block and I cannot get the update or
> delete to work without error. The following is the code from the book.
> Thank you in advance for your help!!!
> <%@. Page language="VB" %>
> <%@. import namespace="system.data" %>
> <%@. import namespace="system.data.oledb" %>
> <script runat="server">
> 'declare connection
> dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;
> Data source=C:\Inetpub\wwwroot\Day8\banking.mdb")
> sub page_load(sender as object, e as eventargs)
> if not page.ispostback then
> FillDataGrid()
> end if
> end sub
> sub submit(sender as object, e as eventargs)
> 'insert new data
> dim i, j as integer
> dim params(7) as string
> dim strText as string
> dim blnGo as boolean = true
> j = 0
> for i = 0 to addpanel.controls.count - 1
> if addpanel.controls(i).gettype is gettype(textbox) then
> strtext = ctype(addpanel.controls(i),textbox).text
> if strtext <> "" then
> params(j) = strtext
> else
> blngo = false
> lblmessage.text = lblmessage.text & "You forgot to add a
> value for " & addpanel.controls(i).id & "<p>"
> lblmessage.style("Forecolor") = "red"
> end if
> j = j + 1
> end if
> next i
> if not blngo then
> exit sub
> end if
> dim strsql as string = "INSERT INTO Users (FirstName, LastName,
> Address, City, State, Zip, Phone) VALUES (" & _
> "'" & params(0) & "'," & _
> "'" & params(1) & "'," & _
> "'" & params(2) & "'," & _
> "'" & params(3) & "'," & _
> "'" & params(4) & "'," & _
> "'" & params(5) & "'," & _
> "'" & params(6) & "')"
> executestatement(strsql)
> filldatagrid()
> end sub
> sub dgData_Edit(sender as object, e as datagridcommandeventargs)
> filldatagrid(e.item.itemindex)
> end sub
> sub dgdata_delete(sender as object, e as datagridcommandeventargs)
> dim strsql = "DELETE FROM Users WHERE ID = " & e.item.itemindex
> executestatement(strsql)
> filldatagrid()
> end sub
> sub dgdata_update(sender as object, e as datagridcommandeventargs)
> if updatedatastore(e) then
> filldatagrid(-1)
> end if
> end sub
> sub dgdata_cancel(sender as object, e as datagridcommandeventargs)
> filldatagrid(-1)
> end sub
> sub dgdata_pageindexchanged(sender as object, e as
> datagridpagechangedeventargs)
> dgdata.databind()
> end sub
> function updatedatastore(e as datagridcommandeventargs) as boolean
> dim i,j as integer
> dim params(7) as string
> dim strtext as string
> dim blnGo as boolean = true
> j = 0
> for i = 1 to e.item.cells.count - 3
> strtext = ctype(e.item.cells(i).controls(0),textbox).text
> if strtext <> "" then
> params(j) = strtext
> else
> blngo = false
> lblmessage.text = lblmessage.text & "You forgot to enter a
> value <p>"
> end if
> next i
> if not blngo then
> return false
> exit function
> end if
> dim strsql as string = "UPDATE Users SET " & _
> "FirstName = '" & params(0) & "'," & _
> "LastName = '" & params(1) & "'," & _
> "Address = '" & params(2) & "'," & _
> "City = '" & params(3) & "'," & _
> "State = '" & params(4) & "'," & _
> "Zip = '" & params(5) & "'," & _
> "Phone = '" & params(6) & "' " & _
> "WHERE ID = " &
> ctype(e.item.cells(0).controls(1),label).text
> executestatement(strsql)
> return blngo
> end function
> sub filldatagrid(optional editindex as integer = -1)
> 'open connection
> dim objcmd as new oledbcommand("select * from Users", conn)
> dim objreader as oledbdatareader
> try
> objcmd.connection.open()
> objreader = objcmd.executereader()
> catch ex as exception
> lblMessage.text = "Error retrieving from the database"
> end try
> dgdata.datasource = objreader
> if not editindex.equals(nothing) then
> dgdata.edititemindex = editindex
> end if
> dgdata.databind()
> objreader.close
> objcmd.connection.close()
> end sub
> function executestatement(strsql as string)
> 'open connection
> dim objcmd as new oledbcommand(strsql, conn)
> try
> objcmd.connection.open()
> objcmd.executenonquery()
> catch ex as exception
> lblMessage.text = "Error updating the database"
> end try
> objcmd.connection.close()
> end function
> </script>
> <html><body>
> <asp:Label id="lblMessage" runat="server"/>
> <form runat="server">
> <asp:Datagrid id="dgData" runat="server"
> BorderColor="Black" gridlines="vertical"
> cellpadding="4" cellspacing="0" width="100%"
> autogeneratecolumns="false"
> ondeletecommand="dgData_Delete"
> onEditcommand="dgData_Edit"
> onCancelcommand="dgData_Cancel"
> onUpdatecommand="dgData_Update"
> onpageindexchanged="dgData_PageIndexChanged">
> <columns>
> <asp:TemplateColumn headertext="ID">
> <itemtemplate>
> <asp:Label id="Name" text='<%#
> container.dataitem("ID") %>' runat="server"/>
> </itemtemplate>
> </asp:templatecolumn>
> <asp:boundcolumn headertext="First Name"
> datafield="FirstName"/>
> <asp:boundcolumn headertext="Last Name"
> datafield="LastName"/>
> <asp:boundcolumn headertext="Address" datafield="Address"/>
> <asp:boundcolumn headertext="City" datafield="City"/>
> <asp:boundcolumn headertext="State" datafield="State"/>
> <asp:boundcolumn headertext="Zip" datafield="Zip"/>
> <asp:boundcolumn headertext="Phone" datafield="Phone"/>
> <asp:editcommandcolumn edittext="Edit" canceltext="Cancel"
> updatetext="Update" headertext="Edit"/>
> <asp:buttoncolumn headertext="" text="Delete"
> commandname="Delete"/>
> </columns>
> </asp:datagrid><p>
> <asp:panel id="AddPanel" runat="server">
> <table>
> <tr>
> <td width="100" valign="top">First and last name: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbFName" runat="server"/>
> <asp:textbox id="tbLName" runat="server"/>
> </td>
> </tr>
> <tr>
> <td width="100" valign="top">Address: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbAddress" runat="server"/>
> </td>
> </tr>
> <tr>
> <td width="100" valign="top">City, State, Zip: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbCity" runat="server"/>,
> <asp:textbox id="tbState" size=2
> runat="server"/>
> <asp:textbox id="tbZip" size=5 runat="server"/>
> </td>
> </tr>
> <tr>
> <td width="100" valign="top">Phone: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbPhone" size=11 runat="server"/>
> </td>
> </tr>
> <tr>
> <td colspan=2 valign="top" align="right">
> <asp:Button id="btSubmit" text="Add" onclick="Submit"
> runat="server"/>
> </td>
> </tr>
> </table>
> </asp:panel>
> </form>
> </body></html
Or download VWD Express Edition for free (For a year anyway). I've been
using it a few weeks from a standing start and whilst I code for fun have
built a great KPI dashboard for work which updates continuously throughout
the day...really productive
http://msdn.microsoft.com/vstudio/express/vwd/
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
nick_hodgeTAKETHISOUT@.zen.co.uk.ANDTHIS
"OHM ( One Handed Man )" <me@.mine.com> wrote in message
news:uKLso9qYGHA.4620@.TK2MSFTNGP04.phx.gbl...
> Two things. !
> 1.) Go and buy visual studio, you really wont go far using notepad (
> Although you can get by without it, it will be a nightmare )
> 2.) You dont say what the error is.?
> --
> ( OHM ) - One Handed Man
> AKA Terry Burns - http://TrainingOn.net
>
> <MPotok@.gmail.com> wrote in message
> news:1145338918.804159.312510@.v46g2000cwv.googlegr oups.com...
>> Hi,
>>
>> I am reading a book on ASP.NET and the following code is from the book
>> (Teach Yourself ASP.NET in 21 Days by Chris Payne). I have typed the
>> code in notepad and I am having a problem with it that I hope someone
>> can help. Basically there is a Submit button which is supposed to
>> update an Access database, but for some reason it keeps on erroring
>> out. I have it in a try-catch block and I cannot get the update or
>> delete to work without error. The following is the code from the book.
>>
>> Thank you in advance for your help!!!
>>
>> <%@. Page language="VB" %>
>> <%@. import namespace="system.data" %>
>> <%@. import namespace="system.data.oledb" %>
>>
>> <script runat="server">
>> 'declare connection
>> dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;
>> Data source=C:\Inetpub\wwwroot\Day8\banking.mdb")
>>
>> sub page_load(sender as object, e as eventargs)
>> if not page.ispostback then
>> FillDataGrid()
>> end if
>> end sub
>>
>> sub submit(sender as object, e as eventargs)
>> 'insert new data
>> dim i, j as integer
>> dim params(7) as string
>> dim strText as string
>> dim blnGo as boolean = true
>>
>> j = 0
>>
>> for i = 0 to addpanel.controls.count - 1
>> if addpanel.controls(i).gettype is gettype(textbox) then
>> strtext = ctype(addpanel.controls(i),textbox).text
>> if strtext <> "" then
>> params(j) = strtext
>> else
>> blngo = false
>> lblmessage.text = lblmessage.text & "You forgot to add a
>> value for " & addpanel.controls(i).id & "<p>"
>> lblmessage.style("Forecolor") = "red"
>> end if
>> j = j + 1
>> end if
>> next i
>>
>> if not blngo then
>> exit sub
>> end if
>>
>> dim strsql as string = "INSERT INTO Users (FirstName, LastName,
>> Address, City, State, Zip, Phone) VALUES (" & _
>> "'" & params(0) & "'," & _
>> "'" & params(1) & "'," & _
>> "'" & params(2) & "'," & _
>> "'" & params(3) & "'," & _
>> "'" & params(4) & "'," & _
>> "'" & params(5) & "'," & _
>> "'" & params(6) & "')"
>>
>> executestatement(strsql)
>> filldatagrid()
>> end sub
>>
>> sub dgData_Edit(sender as object, e as datagridcommandeventargs)
>> filldatagrid(e.item.itemindex)
>> end sub
>>
>> sub dgdata_delete(sender as object, e as datagridcommandeventargs)
>> dim strsql = "DELETE FROM Users WHERE ID = " & e.item.itemindex
>>
>> executestatement(strsql)
>> filldatagrid()
>> end sub
>>
>> sub dgdata_update(sender as object, e as datagridcommandeventargs)
>> if updatedatastore(e) then
>> filldatagrid(-1)
>> end if
>> end sub
>>
>> sub dgdata_cancel(sender as object, e as datagridcommandeventargs)
>> filldatagrid(-1)
>> end sub
>>
>> sub dgdata_pageindexchanged(sender as object, e as
>> datagridpagechangedeventargs)
>> dgdata.databind()
>> end sub
>>
>> function updatedatastore(e as datagridcommandeventargs) as boolean
>> dim i,j as integer
>> dim params(7) as string
>> dim strtext as string
>> dim blnGo as boolean = true
>>
>> j = 0
>>
>> for i = 1 to e.item.cells.count - 3
>> strtext = ctype(e.item.cells(i).controls(0),textbox).text
>> if strtext <> "" then
>> params(j) = strtext
>> else
>> blngo = false
>> lblmessage.text = lblmessage.text & "You forgot to enter a
>> value <p>"
>> end if
>> next i
>>
>> if not blngo then
>> return false
>> exit function
>> end if
>>
>> dim strsql as string = "UPDATE Users SET " & _
>> "FirstName = '" & params(0) & "'," & _
>> "LastName = '" & params(1) & "'," & _
>> "Address = '" & params(2) & "'," & _
>> "City = '" & params(3) & "'," & _
>> "State = '" & params(4) & "'," & _
>> "Zip = '" & params(5) & "'," & _
>> "Phone = '" & params(6) & "' " & _
>> "WHERE ID = " &
>> ctype(e.item.cells(0).controls(1),label).text
>>
>> executestatement(strsql)
>> return blngo
>> end function
>>
>> sub filldatagrid(optional editindex as integer = -1)
>> 'open connection
>> dim objcmd as new oledbcommand("select * from Users", conn)
>> dim objreader as oledbdatareader
>>
>> try
>> objcmd.connection.open()
>> objreader = objcmd.executereader()
>> catch ex as exception
>> lblMessage.text = "Error retrieving from the database"
>> end try
>>
>> dgdata.datasource = objreader
>> if not editindex.equals(nothing) then
>> dgdata.edititemindex = editindex
>> end if
>>
>> dgdata.databind()
>>
>> objreader.close
>> objcmd.connection.close()
>> end sub
>>
>> function executestatement(strsql as string)
>> 'open connection
>> dim objcmd as new oledbcommand(strsql, conn)
>>
>> try
>> objcmd.connection.open()
>> objcmd.executenonquery()
>> catch ex as exception
>> lblMessage.text = "Error updating the database"
>> end try
>>
>> objcmd.connection.close()
>> end function
>> </script>
>>
>> <html><body>
>> <asp:Label id="lblMessage" runat="server"/>
>>
>> <form runat="server">
>> <asp:Datagrid id="dgData" runat="server"
>> BorderColor="Black" gridlines="vertical"
>> cellpadding="4" cellspacing="0" width="100%"
>> autogeneratecolumns="false"
>> ondeletecommand="dgData_Delete"
>> onEditcommand="dgData_Edit"
>> onCancelcommand="dgData_Cancel"
>> onUpdatecommand="dgData_Update"
>> onpageindexchanged="dgData_PageIndexChanged">
>>
>> <columns>
>> <asp:TemplateColumn headertext="ID">
>> <itemtemplate>
>> <asp:Label id="Name" text='<%#
>> container.dataitem("ID") %>' runat="server"/>
>> </itemtemplate>
>> </asp:templatecolumn>
>>
>> <asp:boundcolumn headertext="First Name"
>> datafield="FirstName"/>
>> <asp:boundcolumn headertext="Last Name"
>> datafield="LastName"/>
>> <asp:boundcolumn headertext="Address" datafield="Address"/>
>> <asp:boundcolumn headertext="City" datafield="City"/>
>> <asp:boundcolumn headertext="State" datafield="State"/>
>> <asp:boundcolumn headertext="Zip" datafield="Zip"/>
>> <asp:boundcolumn headertext="Phone" datafield="Phone"/>
>>
>> <asp:editcommandcolumn edittext="Edit" canceltext="Cancel"
>> updatetext="Update" headertext="Edit"/>
>> <asp:buttoncolumn headertext="" text="Delete"
>> commandname="Delete"/>
>> </columns>
>> </asp:datagrid><p>
>>
>> <asp:panel id="AddPanel" runat="server">
>> <table>
>> <tr>
>> <td width="100" valign="top">First and last name: </td>
>> <td width="300" valign="top">
>> <asp:textbox id="tbFName" runat="server"/>
>> <asp:textbox id="tbLName" runat="server"/>
>> </td>
>> </tr>
>>
>> <tr>
>> <td width="100" valign="top">Address: </td>
>> <td width="300" valign="top">
>> <asp:textbox id="tbAddress" runat="server"/>
>> </td>
>> </tr>
>>
>> <tr>
>> <td width="100" valign="top">City, State, Zip: </td>
>> <td width="300" valign="top">
>> <asp:textbox id="tbCity" runat="server"/>,
>> <asp:textbox id="tbState" size=2
>> runat="server"/>
>> <asp:textbox id="tbZip" size=5 runat="server"/>
>> </td>
>> </tr>
>>
>> <tr>
>> <td width="100" valign="top">Phone: </td>
>> <td width="300" valign="top">
>> <asp:textbox id="tbPhone" size=11 runat="server"/>
>> </td>
>> </tr>
>>
>> <tr>
>> <td colspan=2 valign="top" align="right">
>> <asp:Button id="btSubmit" text="Add" onclick="Submit"
>> runat="server"/>
>> </td>
>> </tr>
>> </table>
>> </asp:panel>
>> </form>
>> </body></html>
>>
Thanks for your response...I will go out and buy visual studio, I was
waiting until I finished reading this book, but I guess I should get it
sooner than that. I'm sorry for not being more clear...the error
occurs when the Submit button is clicked and it says "Error updating
the database", which is the error message in the Try-Catch block in the
ExecuteStatement function.
I am using an Access database with one table called Users and it has
the following fields:
FirstName
LastName
Address
City
State
Zip
Phone
Take out your try/catch and see what the exception is when it gets
thrown.
Also, don't buy Visual Studio. Either get hold of one of the express
versions, or write your code by hand. Drop notepad though, you can get
free trials of various programmer's editors (I use Ultra Edit studio
for everything), or even just use a freeware editor like notepad2 - you
just want to make sure you've got syntax highlighting, brace matching
etc. Writing code by hand takes longer, but it's the best way to learn
by a long long way.
Thanks for the help...I wound up getting it to work. Taking out the
try/catch block showed me the error "Must use Updatequery table", or
something of the like. I looked around and found that it was a
permissions issue on the folder containing the db!
it now works and i'm on my way with ASP.NET...i'll probably be back to
ask more questions when i get stuck!
Thanks again all!!!
Newbie help!
I am reading a book on ASP.NET and the following code is from the book
(Teach Yourself ASP.NET in 21 Days by Chris Payne). I have typed the
code in notepad and I am having a problem with it that I hope someone
can help. Basically there is a Submit button which is supposed to
update an Access database, but for some reason it keeps on erroring
out. I have it in a try-catch block and I cannot get the update or
delete to work without error. The following is the code from the book.
Thank you in advance for your help!!!
<%@dotnet.itags.org. Page language="VB" %>
<%@dotnet.itags.org. import namespace="system.data" %>
<%@dotnet.itags.org. import namespace="system.data.oledb" %>
<script runat="server">
'declare connection
dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;
Data source=C:\Inetpub\wwwroot\Day8\banking.mdb")
sub page_load(sender as object, e as eventargs)
if not page.ispostback then
FillDataGrid()
end if
end sub
sub submit(sender as object, e as eventargs)
'insert new data
dim i, j as integer
dim params(7) as string
dim strText as string
dim blnGo as boolean = true
j = 0
for i = 0 to addpanel.controls.count - 1
if addpanel.controls(i).gettype is gettype(textbox) then
strtext = ctype(addpanel.controls(i),textbox).text
if strtext <> "" then
params(j) = strtext
else
blngo = false
lblmessage.text = lblmessage.text & "You forgot to add a
value for " & addpanel.controls(i).id & "<p>"
lblmessage.style("Forecolor") = "red"
end if
j = j + 1
end if
next i
if not blngo then
exit sub
end if
dim strsql as string = "INSERT INTO Users (FirstName, LastName,
Address, City, State, Zip, Phone) VALUES (" & _
"'" & params(0) & "'," & _
"'" & params(1) & "'," & _
"'" & params(2) & "'," & _
"'" & params(3) & "'," & _
"'" & params(4) & "'," & _
"'" & params(5) & "'," & _
"'" & params(6) & "')"
executestatement(strsql)
filldatagrid()
end sub
sub dgData_Edit(sender as object, e as datagridcommandeventargs)
filldatagrid(e.item.itemindex)
end sub
sub dgdata_delete(sender as object, e as datagridcommandeventargs)
dim strsql = "DELETE FROM Users WHERE ID = " & e.item.itemindex
executestatement(strsql)
filldatagrid()
end sub
sub dgdata_update(sender as object, e as datagridcommandeventargs)
if updatedatastore(e) then
filldatagrid(-1)
end if
end sub
sub dgdata_cancel(sender as object, e as datagridcommandeventargs)
filldatagrid(-1)
end sub
sub dgdata_pageindexchanged(sender as object, e as
datagridpagechangedeventargs)
dgdata.databind()
end sub
function updatedatastore(e as datagridcommandeventargs) as boolean
dim i,j as integer
dim params(7) as string
dim strtext as string
dim blnGo as boolean = true
j = 0
for i = 1 to e.item.cells.count - 3
strtext = ctype(e.item.cells(i).controls(0),textbox).text
if strtext <> "" then
params(j) = strtext
else
blngo = false
lblmessage.text = lblmessage.text & "You forgot to enter a
value <p>"
end if
next i
if not blngo then
return false
exit function
end if
dim strsql as string = "UPDATE Users SET " & _
"FirstName = '" & params(0) & "'," & _
"LastName = '" & params(1) & "'," & _
"Address = '" & params(2) & "'," & _
"City = '" & params(3) & "'," & _
"State = '" & params(4) & "'," & _
"Zip = '" & params(5) & "'," & _
"Phone = '" & params(6) & "' " & _
"WHERE ID = " &
ctype(e.item.cells(0).controls(1),label).text
executestatement(strsql)
return blngo
end function
sub filldatagrid(optional editindex as integer = -1)
'open connection
dim objcmd as new oledbcommand("select * from Users", conn)
dim objreader as oledbdatareader
try
objcmd.connection.open()
objreader = objcmd.executereader()
catch ex as exception
lblMessage.text = "Error retrieving from the database"
end try
dgdata.datasource = objreader
if not editindex.equals(nothing) then
dgdata.edititemindex = editindex
end if
dgdata.databind()
objreader.close
objcmd.connection.close()
end sub
function executestatement(strsql as string)
'open connection
dim objcmd as new oledbcommand(strsql, conn)
try
objcmd.connection.open()
objcmd.executenonquery()
catch ex as exception
lblMessage.text = "Error updating the database"
end try
objcmd.connection.close()
end function
</script>
<html><body>
<asp:Label id="lblMessage" runat="server"/>
<form runat="server">
<asp:Datagrid id="dgData" runat="server"
BorderColor="Black" gridlines="vertical"
cellpadding="4" cellspacing="0" width="100%"
autogeneratecolumns="false"
ondeletecommand="dgData_Delete"
onEditcommand="dgData_Edit"
onCancelcommand="dgData_Cancel"
onUpdatecommand="dgData_Update"
onpageindexchanged="dgData_PageIndexChanged">
<columns>
<asp:TemplateColumn headertext="ID">
<itemtemplate>
<asp:Label id="Name" text='<%#
container.dataitem("ID") %>' runat="server"/>
</itemtemplate>
</asp:templatecolumn>
<asp:boundcolumn headertext="First Name"
datafield="FirstName"/>
<asp:boundcolumn headertext="Last Name"
datafield="LastName"/>
<asp:boundcolumn headertext="Address" datafield="Address"/>
<asp:boundcolumn headertext="City" datafield="City"/>
<asp:boundcolumn headertext="State" datafield="State"/>
<asp:boundcolumn headertext="Zip" datafield="Zip"/>
<asp:boundcolumn headertext="Phone" datafield="Phone"/>
<asp:editcommandcolumn edittext="Edit" canceltext="Cancel"
updatetext="Update" headertext="Edit"/>
<asp:buttoncolumn headertext="" text="Delete"
commandname="Delete"/>
</columns>
</asp:datagrid><p>
<asp:panel id="AddPanel" runat="server">
<table>
<tr>
<td width="100" valign="top">First and last name: </td>
<td width="300" valign="top">
<asp:textbox id="tbFName" runat="server"/>
<asp:textbox id="tbLName" runat="server"/>
</td>
</tr>
<tr>
<td width="100" valign="top">Address: </td>
<td width="300" valign="top">
<asp:textbox id="tbAddress" runat="server"/>
</td>
</tr>
<tr>
<td width="100" valign="top">City, State, Zip: </td>
<td width="300" valign="top">
<asp:textbox id="tbCity" runat="server"/>,
<asp:textbox id="tbState" size=2
runat="server"/>
<asp:textbox id="tbZip" size=5 runat="server"/>
</td>
</tr>
<tr>
<td width="100" valign="top">Phone: </td>
<td width="300" valign="top">
<asp:textbox id="tbPhone" size=11 runat="server"/>
</td>
</tr>
<tr>
<td colspan=2 valign="top">
<asp:Button id="btSubmit" text="Add" onclick="Submit"
runat="server"/>
</td>
</tr>
</table>
</asp:panel>
</form>
</body></html>Two things. !
1.) Go and buy visual studio, you really wont go far using notepad (
Although you can get by without it, it will be a nightmare )
2.) You dont say what the error is.?
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
<MPotok@.gmail.com> wrote in message
news:1145338918.804159.312510@.v46g2000cwv.googlegroups.com...
> Hi,
> I am reading a book on ASP.NET and the following code is from the book
> (Teach Yourself ASP.NET in 21 Days by Chris Payne). I have typed the
> code in notepad and I am having a problem with it that I hope someone
> can help. Basically there is a Submit button which is supposed to
> update an Access database, but for some reason it keeps on erroring
> out. I have it in a try-catch block and I cannot get the update or
> delete to work without error. The following is the code from the book.
> Thank you in advance for your help!!!
> <%@. Page language="VB" %>
> <%@. import namespace="system.data" %>
> <%@. import namespace="system.data.oledb" %>
> <script runat="server">
> 'declare connection
> dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;
> Data source=C:\Inetpub\wwwroot\Day8\banking.mdb")
> sub page_load(sender as object, e as eventargs)
> if not page.ispostback then
> FillDataGrid()
> end if
> end sub
> sub submit(sender as object, e as eventargs)
> 'insert new data
> dim i, j as integer
> dim params(7) as string
> dim strText as string
> dim blnGo as boolean = true
> j = 0
> for i = 0 to addpanel.controls.count - 1
> if addpanel.controls(i).gettype is gettype(textbox) then
> strtext = ctype(addpanel.controls(i),textbox).text
> if strtext <> "" then
> params(j) = strtext
> else
> blngo = false
> lblmessage.text = lblmessage.text & "You forgot to add a
> value for " & addpanel.controls(i).id & "<p>"
> lblmessage.style("Forecolor") = "red"
> end if
> j = j + 1
> end if
> next i
> if not blngo then
> exit sub
> end if
> dim strsql as string = "INSERT INTO Users (FirstName, LastName,
> Address, City, State, Zip, Phone) VALUES (" & _
> "'" & params(0) & "'," & _
> "'" & params(1) & "'," & _
> "'" & params(2) & "'," & _
> "'" & params(3) & "'," & _
> "'" & params(4) & "'," & _
> "'" & params(5) & "'," & _
> "'" & params(6) & "')"
> executestatement(strsql)
> filldatagrid()
> end sub
> sub dgData_Edit(sender as object, e as datagridcommandeventargs)
> filldatagrid(e.item.itemindex)
> end sub
> sub dgdata_delete(sender as object, e as datagridcommandeventargs)
> dim strsql = "DELETE FROM Users WHERE ID = " & e.item.itemindex
> executestatement(strsql)
> filldatagrid()
> end sub
> sub dgdata_update(sender as object, e as datagridcommandeventargs)
> if updatedatastore(e) then
> filldatagrid(-1)
> end if
> end sub
> sub dgdata_cancel(sender as object, e as datagridcommandeventargs)
> filldatagrid(-1)
> end sub
> sub dgdata_pageindexchanged(sender as object, e as
> datagridpagechangedeventargs)
> dgdata.databind()
> end sub
> function updatedatastore(e as datagridcommandeventargs) as boolean
> dim i,j as integer
> dim params(7) as string
> dim strtext as string
> dim blnGo as boolean = true
> j = 0
> for i = 1 to e.item.cells.count - 3
> strtext = ctype(e.item.cells(i).controls(0),textbox).text
> if strtext <> "" then
> params(j) = strtext
> else
> blngo = false
> lblmessage.text = lblmessage.text & "You forgot to enter a
> value <p>"
> end if
> next i
> if not blngo then
> return false
> exit function
> end if
> dim strsql as string = "UPDATE Users SET " & _
> "FirstName = '" & params(0) & "'," & _
> "LastName = '" & params(1) & "'," & _
> "Address = '" & params(2) & "'," & _
> "City = '" & params(3) & "'," & _
> "State = '" & params(4) & "'," & _
> "Zip = '" & params(5) & "'," & _
> "Phone = '" & params(6) & "' " & _
> "WHERE ID = " &
> ctype(e.item.cells(0).controls(1),label).text
> executestatement(strsql)
> return blngo
> end function
> sub filldatagrid(optional editindex as integer = -1)
> 'open connection
> dim objcmd as new oledbcommand("select * from Users", conn)
> dim objreader as oledbdatareader
> try
> objcmd.connection.open()
> objreader = objcmd.executereader()
> catch ex as exception
> lblMessage.text = "Error retrieving from the database"
> end try
> dgdata.datasource = objreader
> if not editindex.equals(nothing) then
> dgdata.edititemindex = editindex
> end if
> dgdata.databind()
> objreader.close
> objcmd.connection.close()
> end sub
> function executestatement(strsql as string)
> 'open connection
> dim objcmd as new oledbcommand(strsql, conn)
> try
> objcmd.connection.open()
> objcmd.executenonquery()
> catch ex as exception
> lblMessage.text = "Error updating the database"
> end try
> objcmd.connection.close()
> end function
> </script>
> <html><body>
> <asp:Label id="lblMessage" runat="server"/>
> <form runat="server">
> <asp:Datagrid id="dgData" runat="server"
> BorderColor="Black" gridlines="vertical"
> cellpadding="4" cellspacing="0" width="100%"
> autogeneratecolumns="false"
> ondeletecommand="dgData_Delete"
> onEditcommand="dgData_Edit"
> onCancelcommand="dgData_Cancel"
> onUpdatecommand="dgData_Update"
> onpageindexchanged="dgData_PageIndexChanged">
> <columns>
> <asp:TemplateColumn headertext="ID">
> <itemtemplate>
> <asp:Label id="Name" text='<%#
> container.dataitem("ID") %>' runat="server"/>
> </itemtemplate>
> </asp:templatecolumn>
> <asp:boundcolumn headertext="First Name"
> datafield="FirstName"/>
> <asp:boundcolumn headertext="Last Name"
> datafield="LastName"/>
> <asp:boundcolumn headertext="Address" datafield="Address"/>
> <asp:boundcolumn headertext="City" datafield="City"/>
> <asp:boundcolumn headertext="State" datafield="State"/>
> <asp:boundcolumn headertext="Zip" datafield="Zip"/>
> <asp:boundcolumn headertext="Phone" datafield="Phone"/>
> <asp:editcommandcolumn edittext="Edit" canceltext="Cancel"
> updatetext="Update" headertext="Edit"/>
> <asp:buttoncolumn headertext="" text="Delete"
> commandname="Delete"/>
> </columns>
> </asp:datagrid><p>
> <asp:panel id="AddPanel" runat="server">
> <table>
> <tr>
> <td width="100" valign="top">First and last name: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbFName" runat="server"/>
> <asp:textbox id="tbLName" runat="server"/>
> </td>
> </tr>
> <tr>
> <td width="100" valign="top">Address: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbAddress" runat="server"/>
> </td>
> </tr>
> <tr>
> <td width="100" valign="top">City, State, Zip: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbCity" runat="server"/>,
> <asp:textbox id="tbState" size=2
> runat="server"/>
> <asp:textbox id="tbZip" size=5 runat="server"/>
> </td>
> </tr>
> <tr>
> <td width="100" valign="top">Phone: </td>
> <td width="300" valign="top">
> <asp:textbox id="tbPhone" size=11 runat="server"/>
> </td>
> </tr>
> <tr>
> <td colspan=2 valign="top">
> <asp:Button id="btSubmit" text="Add" onclick="Submit"
> runat="server"/>
> </td>
> </tr>
> </table>
> </asp:panel>
> </form>
> </body></html>
>
Or download VWD Express Edition for free (For a year anyway). I've been
using it a few w
built a great KPI dashboard for work which updates continuously throughout
the day...really productive
http://msdn.microsoft.com/vstudio/express/vwd/
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
nick_hodgeTAKETHISOUT@.zen.co.uk.ANDTHIS
"OHM ( One Handed Man )" <me@.mine.com> wrote in message
news:uKLso9qYGHA.4620@.TK2MSFTNGP04.phx.gbl...
> Two things. !
> 1.) Go and buy visual studio, you really wont go far using notepad (
> Although you can get by without it, it will be a nightmare )
> 2.) You dont say what the error is.?
> --
> ( OHM ) - One Handed Man
> AKA Terry Burns - http://TrainingOn.net
>
> <MPotok@.gmail.com> wrote in message
> news:1145338918.804159.312510@.v46g2000cwv.googlegroups.com...
>
Thanks for your response...I will go out and buy visual studio, I was
waiting until I finished reading this book, but I guess I should get it
sooner than that. I'm sorry for not being more clear...the error
occurs when the Submit button is clicked and it says "Error updating
the database", which is the error message in the Try-Catch block in the
ExecuteStatement function.
I am using an Access database with one table called Users and it has
the following fields:
FirstName
LastName
Address
City
State
Zip
Phone
Take out your try/catch and see what the exception is when it gets
thrown.
Also, don't buy Visual Studio. Either get hold of one of the express
versions, or write your code by hand. Drop notepad though, you can get
free trials of various programmer's editors (I use Ultra Edit studio
for everything), or even just use a freeware editor like notepad2 - you
just want to make sure you've got syntax highlighting, brace matching
etc. Writing code by hand takes longer, but it's the best way to learn
by a long long way.
Thanks for the help...I wound up getting it to work. Taking out the
try/catch block showed me the error "Must use Updatequery table", or
something of the like. I looked around and found that it was a
permissions issue on the folder containing the db!
it now works and i'm on my way with ASP.NET...i'll probably be back to
ask more questions when i get stuck!
Thanks again all!!!
Thursday, March 22, 2012
Newbie issue: Error creating Web Service in VS 2003
Newbie issue: Error creating Web Service in VS 2003
When trying to create a new C# Web Service in VS 2003, I get the following error
message:
"The Web server reported the following error when attempting to create or open
the Web project located at the following URL: 'http://localhost/WebService1'.
'HTTP/1.1 500 Internal Server Error'.
The Event Viewer contains 2 copies of this entry:
"Failed to execute request because the App-Domain could not be created. Error:
0x80131534" (Source: ASP.NET 1.1.4322.0, Event ID: 1088).
IIS Log file contains the following:
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2004-07-20 13:44:50
#Fields: time c-ip cs-method cs-uri-stem sc-status
13:44:50 127.0.0.1 GET /WebService1/get_aspx_ver.aspx 500
13:44:50 127.0.0.1 GET /get_aspx_ver.aspx 500
I have:
Uninstalled VS 2003, the .NET v1.1 Framework, and IIS.
Re-installed IIS, the .NET v1.1 Framework, and VS 2003.
Given the ASPNET user "Admin" rights and I/O rights to the C:\Inetpub folder.
Modified the <processModel> section of the Machine.Config file so that the the
SYSTEM account is being used.
Run aspnet_regiis.exe.
Probably done some other things I can no longer remember.
The machine is my normal local development box - running XP Pro.
I can hit http://localhost and all is well.
This is the first time I've tried to create a Web Service on this machine, so I
can't tell you if something has changed or if it ever worked.
I'm assuming it's a rights issue of some sort (although that get_aspx_ver.aspx
returning a '500' has me a bit confused - but like I mentioned, I'm a newbie).
Any suggestions would be much appreciated.
Thanks!
-- JimDid u google it ??
u'll find some posts on it ... are u developing on a domain controller
itself ?
--
Regards,
Mike
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword: phoetus)
"JPH" <JPH_member@.newsguy.com> wrote in message
news:cdj8ad02cop@.drn.newsguy.com...
> Hi all! Here's my problem:
> When trying to create a new C# Web Service in VS 2003, I get the following
error
> message:
> "The Web server reported the following error when attempting to create or
open
> the Web project located at the following URL:
'http://localhost/WebService1'.
> 'HTTP/1.1 500 Internal Server Error'.
>
> The Event Viewer contains 2 copies of this entry:
> "Failed to execute request because the App-Domain could not be created.
Error:
> 0x80131534" (Source: ASP.NET 1.1.4322.0, Event ID: 1088).
>
> IIS Log file contains the following:
> #Software: Microsoft Internet Information Services 5.1
> #Version: 1.0
> #Date: 2004-07-20 13:44:50
> #Fields: time c-ip cs-method cs-uri-stem sc-status
> 13:44:50 127.0.0.1 GET /WebService1/get_aspx_ver.aspx 500
> 13:44:50 127.0.0.1 GET /get_aspx_ver.aspx 500
> I have:
> Uninstalled VS 2003, the .NET v1.1 Framework, and IIS.
> Re-installed IIS, the .NET v1.1 Framework, and VS 2003.
> Given the ASPNET user "Admin" rights and I/O rights to the C:\Inetpub
folder.
> Modified the <processModel> section of the Machine.Config file so that the
the
> SYSTEM account is being used.
> Run aspnet_regiis.exe.
> Probably done some other things I can no longer remember.
>
> The machine is my normal local development box - running XP Pro.
> I can hit http://localhost and all is well.
> This is the first time I've tried to create a Web Service on this machine,
so I
> can't tell you if something has changed or if it ever worked.
> I'm assuming it's a rights issue of some sort (although that
get_aspx_ver.aspx
> returning a '500' has me a bit confused - but like I mentioned, I'm a
newbie).
> Any suggestions would be much appreciated.
> Thanks!
> -- Jim
--
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 20/07/2004
Oh yeah, I definitely googled it. Tried everything I found - no luck
whatsoever.
And nope - not on a domain controller, though I did try q315158 just in case -
no luck there either.
In article <ulGYmOnbEHA.1644@.tk2msftngp13.phx.gbl>, Mike Smith says...
>Did u google it ??
>u'll find some posts on it ... are u developing on a domain controller
>itself ?
>--
>Regards,
>Mike
>http://bikesh.europe.webmatrixhosting.net
>http://www.planetsourcecode.com (search keyword: phoetus)
>"JPH" <JPH_member@.newsguy.com> wrote in message
>news:cdj8ad02cop@.drn.newsguy.com...
>> Hi all! Here's my problem:
>>
>> When trying to create a new C# Web Service in VS 2003, I get the following
>error
>> message:
>> "The Web server reported the following error when attempting to create or
>open
>> the Web project located at the following URL:
>'http://localhost/WebService1'.
>> 'HTTP/1.1 500 Internal Server Error'.
>>
>>
>> The Event Viewer contains 2 copies of this entry:
>> "Failed to execute request because the App-Domain could not be created.
>Error:
>> 0x80131534" (Source: ASP.NET 1.1.4322.0, Event ID: 1088).
>>
>>
>> IIS Log file contains the following:
>> #Software: Microsoft Internet Information Services 5.1
>> #Version: 1.0
>> #Date: 2004-07-20 13:44:50
>> #Fields: time c-ip cs-method cs-uri-stem sc-status
>> 13:44:50 127.0.0.1 GET /WebService1/get_aspx_ver.aspx 500
>> 13:44:50 127.0.0.1 GET /get_aspx_ver.aspx 500
>>
>> I have:
>> Uninstalled VS 2003, the .NET v1.1 Framework, and IIS.
>> Re-installed IIS, the .NET v1.1 Framework, and VS 2003.
>> Given the ASPNET user "Admin" rights and I/O rights to the C:\Inetpub
>folder.
>> Modified the <processModel> section of the Machine.Config file so that the
>the
>> SYSTEM account is being used.
>> Run aspnet_regiis.exe.
>> Probably done some other things I can no longer remember.
>>
>>
>> The machine is my normal local development box - running XP Pro.
>> I can hit http://localhost and all is well.
>> This is the first time I've tried to create a Web Service on this machine,
>so I
>> can't tell you if something has changed or if it ever worked.
>>
>> I'm assuming it's a rights issue of some sort (although that
>get_aspx_ver.aspx
>> returning a '500' has me a bit confused - but like I mentioned, I'm a
>newbie).
>>
>> Any suggestions would be much appreciated.
>>
>> Thanks!
>>
>> -- Jim
>>
>
>--
>Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.723 / Virus Database: 479 - Release Date: 20/07/2004