Thank you in advance for any possible help you have to offer, before I
pull my hair out!
I am incredibly frustrated attempting to learn asp.net. Its really
pissing me off. Please help.
First, please tell me the best asp .net book to purchase for a stupid
beginner, preferably with vb instead of C. I have no idea what most of
the c code in my current book means and in trying to learn the .net
stuff at the same time, its giving me quite the cranky temper. I have
a programming background, so I have no idea why this is so difficult for
me.
Secondly,the following code gives me an error for this line
dbread=dbcomm.E xecuteReader() saying "no value given for one or more
parameters". Whats going on, please?
<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="Syst em.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn,sql,dbco mm,dbread
dbconn=New OleDbConnection
("Provider=Micr osoft.Jet.OLEDB .4.0;data source=d:\APCA\ Technical
Assistance Team\Plan Database\TA_Pla ns.mdb")
dbconn.Open()
sql="SELECT * FROM tblorgs order by organization"
dbcomm=New OleDbCommand(sq l,dbconn)
dbread=dbcomm.E xecuteReader()
orgs.DataSource =dbread
orgs.DataBind()
dbread.Close()
dbconn.Close()
end sub
Sub Search_click(s as object, e as eventargs)
dim dbconn,sql,dbco mm,dbread
Dim filtervalue as string = orgs.selectedit em.text
dbconn=New OleDbConnection
("Provider=Micr osoft.Jet.OLEDB .4.0;data source=d:\APCA\ Technical
Assistance Team\Plan Database\TA_Pla ns.mdb")
dbconn.Open()
sql="SELECT tblOrgs.Organiz ation, [CategoryID] & '.' &
[SectionNumber] AS [Section], tblSection.Sect ionName AS Name,
tblNeeds.NeedID AS [Need Identified], tblNeeds.Assist anceRequested AS
[Assistance Requested], tblNeeds.NoAssi stanceNeeded AS [No Assistance
Needed] FROM tblSection INNER JOIN (tblOrgs INNER JOIN tblNeeds ON
tblOrgs.OrgID = tblNeeds.OrgID) ON tblSection.Sect ionID =
tblNeeds.Sectio nID where tblOrgs.OrgdID= " & filterValue
dbcomm=New OleDbCommand(sq l,dbconn)
dbread=dbcomm.E xecuteReader()
SEARCHRESULTS.D ataSource=dbrea d
searchresults.D ataBind()
dbread.Close()
dbconn.Close()
END SUB
Sub DataList1_Selec tedIndexChanged (sender As Object, e As EventArgs)
End Sub
Sub orgs_SelectedIn dexChanged(send er As Object, e As EventArgs)
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<ASP:DropDownLi st id="orgs" runat="server" AutoPostBack="T rue"
DataValueField= "orgid" datatextfield=" organization"
OnSelectedIndex Changed="orgs_S electedIndexCha nged"></ASP:DropDownLis t>
<asp:button id="search" onclick="search _click" runat="server"
text="search for data"></asp:button>
</form>
<ASP:DataGrid id="searchresul ts" runat="server" Width="100%"
BackColor="whit e" BorderColor="bl ack" ShowFooter="fal se"
CellPadding="3" CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
Headerstyle-BackColor="ligh tblue" Headerstyle-Font-Size="10pt"
Headerstyle-Font-Style="bold" MaintainState=" false"
BorderStyle="Do tted">
<HeaderStyle font-size="10pt" backcolor="Ligh tBlue">
</HeaderStyle>
</ASP:DataGrid>
</body>
</html>
--
BethF, Anchorage, AK
pull my hair out!
I am incredibly frustrated attempting to learn asp.net. Its really
pissing me off. Please help.
First, please tell me the best asp .net book to purchase for a stupid
beginner, preferably with vb instead of C. I have no idea what most of
the c code in my current book means and in trying to learn the .net
stuff at the same time, its giving me quite the cranky temper. I have
a programming background, so I have no idea why this is so difficult for
me.
Secondly,the following code gives me an error for this line
dbread=dbcomm.E xecuteReader() saying "no value given for one or more
parameters". Whats going on, please?
<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="Syst em.Data.OleDb" %>
<script runat="server">
sub Page_Load
dim dbconn,sql,dbco mm,dbread
dbconn=New OleDbConnection
("Provider=Micr osoft.Jet.OLEDB .4.0;data source=d:\APCA\ Technical
Assistance Team\Plan Database\TA_Pla ns.mdb")
dbconn.Open()
sql="SELECT * FROM tblorgs order by organization"
dbcomm=New OleDbCommand(sq l,dbconn)
dbread=dbcomm.E xecuteReader()
orgs.DataSource =dbread
orgs.DataBind()
dbread.Close()
dbconn.Close()
end sub
Sub Search_click(s as object, e as eventargs)
dim dbconn,sql,dbco mm,dbread
Dim filtervalue as string = orgs.selectedit em.text
dbconn=New OleDbConnection
("Provider=Micr osoft.Jet.OLEDB .4.0;data source=d:\APCA\ Technical
Assistance Team\Plan Database\TA_Pla ns.mdb")
dbconn.Open()
sql="SELECT tblOrgs.Organiz ation, [CategoryID] & '.' &
[SectionNumber] AS [Section], tblSection.Sect ionName AS Name,
tblNeeds.NeedID AS [Need Identified], tblNeeds.Assist anceRequested AS
[Assistance Requested], tblNeeds.NoAssi stanceNeeded AS [No Assistance
Needed] FROM tblSection INNER JOIN (tblOrgs INNER JOIN tblNeeds ON
tblOrgs.OrgID = tblNeeds.OrgID) ON tblSection.Sect ionID =
tblNeeds.Sectio nID where tblOrgs.OrgdID= " & filterValue
dbcomm=New OleDbCommand(sq l,dbconn)
dbread=dbcomm.E xecuteReader()
SEARCHRESULTS.D ataSource=dbrea d
searchresults.D ataBind()
dbread.Close()
dbconn.Close()
END SUB
Sub DataList1_Selec tedIndexChanged (sender As Object, e As EventArgs)
End Sub
Sub orgs_SelectedIn dexChanged(send er As Object, e As EventArgs)
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<ASP:DropDownLi st id="orgs" runat="server" AutoPostBack="T rue"
DataValueField= "orgid" datatextfield=" organization"
OnSelectedIndex Changed="orgs_S electedIndexCha nged"></ASP:DropDownLis t>
<asp:button id="search" onclick="search _click" runat="server"
text="search for data"></asp:button>
</form>
<ASP:DataGrid id="searchresul ts" runat="server" Width="100%"
BackColor="whit e" BorderColor="bl ack" ShowFooter="fal se"
CellPadding="3" CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
Headerstyle-BackColor="ligh tblue" Headerstyle-Font-Size="10pt"
Headerstyle-Font-Style="bold" MaintainState=" false"
BorderStyle="Do tted">
<HeaderStyle font-size="10pt" backcolor="Ligh tBlue">
</HeaderStyle>
</ASP:DataGrid>
</body>
</html>
--
BethF, Anchorage, AK
Comment