Showing posts with label book. Show all posts
Showing posts with label book. Show all posts

Monday, March 26, 2012

Please Guide me

Hi,

I have just started learning ASP.NET. My background is in Cold Fusion, Perl, C++ and some JAVA.
I got this book on asp.net by microsoft. "ASP.NET programming with Visual Basic.NET STEP by STEP". The book is ok. I am trying to find some code samples which are good for beginners (i mean not very complex). Where can i find such samples which i can download and understand the actual usage of asp.net.

Please help me. I am lost. I have read half of the book, and still not very clear on some of the concepts. Is it easy to learn on my own or should taking some kind of training is a good idea.

Thanks.Check out:
ASPNet101.com
That should help a little to get you started, at least

also - remember that the basic concept of ASP.Net is that it is Event Driven and Object Oriented - - it brings actual programming concepts (like Visual Basic, etc) to web programming.

Every Web form tag is considered an object - - each object has properties - - (and more)
To 'Do' something with any of these objects, it requires an event, like, a button would have a Click Event (among others) - - there is no submission of a form, per se, any more - - you can program a button to do anything you'd like.

First thing I'd narrow in on, other than the basic concept of ASP.Net, is the Web Controls (Server Controls) that ASP.Net has built in (button, textbox, etc) - - - much of the real power comes from there - -
Next, I'd check out ADO.Net - - which is what ASP.Net uses for 'talking' to Databases (just about any flavor db that you need).....

Please Help

I am writing a guest book for a web page that I am developing at the moment. The guest book is kept in an access database.

I can get the data out alright and display it, however the problem occurs when the user goes to add a comment.

Everything works fine. The user puts all the info in and then clicks on the submit button. It seems that it works. But when the page refreshes the data is not there.

I think there must be something wrong with the add function.

Could some one please help me out as I am at the end of my witts.

The code is below. Cheers,

Public Function Add(ByVal Author As String, ByVal Email As String, _
ByVal Homepage As String, ByVal State As String, ByVal Comment As String) As Boolean
Dim sql As String = "INSERT INTO Comments (Author, Email, Homepage, State, Comment) "
sql += "VALUES (@dotnet.itags.org.Author, @dotnet.itags.org.Email, @dotnet.itags.org.Homepage, @dotnet.itags.org.State, @dotnet.itags.org.Comment)"
' create a new OleDbCommand and set its params
Dim myCmd As OleDbCommand = New OleDbCommand(sql, _Connection)
myCmd.Parameters.Add(New OleDbParameter("@dotnet.itags.org.Author", OleDbType.VarChar, 50))
myCmd.Parameters("@dotnet.itags.org.Author").Value = Author.Trim()
myCmd.Parameters.Add(New OleDbParameter("@dotnet.itags.org.Email", OleDbType.VarChar, 50))
myCmd.Parameters("@dotnet.itags.org.Email").Value = Email.Trim()
myCmd.Parameters.Add(New OleDbParameter("@dotnet.itags.org.Homepage", OleDbType.VarChar, 100))
myCmd.Parameters("@dotnet.itags.org.Homepage").Value = Homepage.Trim()
myCmd.Parameters.Add(New OleDbParameter("@dotnet.itags.org.State", OleDbType.VarChar, 50))
myCmd.Parameters("@dotnet.itags.org.State").Value = State.Trim()
myCmd.Parameters.Add(New OleDbParameter("@dotnet.itags.org.Comment", OleDbType.VarChar))
myCmd.Parameters("@dotnet.itags.org.Comment").Value = EncodeHTMLText(Comment.Trim())
Add = True
myCmd.Connection.Open()
Try
myCmd.ExecuteNonQuery()
Catch e As OleDbException
Add = False
Finally
myCmd.Connection.Close()
End Try
End FunctionHave you tried using ? instead of @.paramname:-

Dim sql As String = "INSERT INTO Comments (Author, Email, Homepage, State, Comment) "
sql &= "VALUES (?, ?, ?, ?, ?)"
I gave up and re wrote the form using ADODB. My code is below. If any one has any ways to improve please tell me.

Thankx for your help....

Dim rs As ADODB.Recordset
rs = New ADODB.Recordset()
rs.CursorType = ADODB.CursorTypeEnum.adOpenKeyset
rs.LockType = ADODB.LockTypeEnum.adLockOptimistic
rs.Open("Comments", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\webspace\myweb.com\db\Guestbook.mdb;Persist Security Info=False;", , , ADODB.CommandTypeEnum.adCmdTable)
rs.AddNew()
rs.Fields(1).Value = Author.Text
rs.Fields(2).Value = Email.Text
rs.Fields(3).Value = Homepage.Text
rs.Fields(4).Value = State.Text
rs.Fields(5).Value = Comment.Text
rs.Update()
rs.Close()
rs = Nothing

Saturday, March 24, 2012

Please help : WebParts won't show up in IE

Hi,
I've been reading a book about webparts and am now trying some of the
examples from the book, but I crash on the first, most simple (following)
example :
I create a new website in VS2005
I add a WebPartManager to the default.aspx by dragging it from the toolbox
I then add a WebPartZone to the default.aspx by draggin it from the toolbox
I then add a Web-Textbox to the WebPartZone
Then I press F5, an ASP.NET development server shows up in my system tray
and I see that IE is started, then after a while IE states that 'Internet
Explorer cannot display the webpage', no ASP.NET error, nothing. After
removing the WebPartManager and the WebPartZone, the page displays just fine
(empty though), but no error in IE.
I have no code in the default.aspx.vb.
Any thoughts ? I must be missing a very simple something...
Regards,
Jurjen.During install of the new BETA2 version of IE7, I uninstalled IE7 and tried
my little project against IE6, this time IE showed me an ASP.NET exception
saying it was looking for database aspnetdb wich was non-existing. After
creating the database the example worked just fine in both IE6 and IE7.
Jurjen.
"Jurjen de Groot" <info@.gits-online.nl> wrote in message
news:OCputNRkGHA.5036@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I've been reading a book about webparts and am now trying some of the
> examples from the book, but I crash on the first, most simple (following)
> example :
> I create a new website in VS2005
> I add a WebPartManager to the default.aspx by dragging it from the toolbox
> I then add a WebPartZone to the default.aspx by draggin it from the
> toolbox
> I then add a Web-Textbox to the WebPartZone
> Then I press F5, an ASP.NET development server shows up in my system tray
> and I see that IE is started, then after a while IE states that 'Internet
> Explorer cannot display the webpage', no ASP.NET error, nothing. After
> removing the WebPartManager and the WebPartZone, the page displays just
> fine
> (empty though), but no error in IE.
> I have no code in the default.aspx.vb.
> Any thoughts ? I must be missing a very simple something...
>
> Regards,
> Jurjen.
>
>

Please help : WebParts wont show up in IE

Hi,

I've been reading a book about webparts and am now trying some of the
examples from the book, but I crash on the first, most simple (following)
example :

I create a new website in VS2005
I add a WebPartManager to the default.aspx by dragging it from the toolbox
I then add a WebPartZone to the default.aspx by draggin it from the toolbox
I then add a Web-Textbox to the WebPartZone
Then I press F5, an ASP.NET development server shows up in my system tray
and I see that IE is started, then after a while IE states that 'Internet
Explorer cannot display the webpage', no ASP.NET error, nothing. After
removing the WebPartManager and the WebPartZone, the page displays just fine
(empty though), but no error in IE.

I have no code in the default.aspx.vb.

Any thoughts ? I must be missing a very simple something...

Regards,
Jurjen.During install of the new BETA2 version of IE7, I uninstalled IE7 and tried
my little project against IE6, this time IE showed me an ASP.NET exception
saying it was looking for database aspnetdb wich was non-existing. After
creating the database the example worked just fine in both IE6 and IE7.

Jurjen.

"Jurjen de Groot" <info@.gits-online.nl> wrote in message
news:OCputNRkGHA.5036@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I've been reading a book about webparts and am now trying some of the
> examples from the book, but I crash on the first, most simple (following)
> example :
> I create a new website in VS2005
> I add a WebPartManager to the default.aspx by dragging it from the toolbox
> I then add a WebPartZone to the default.aspx by draggin it from the
> toolbox
> I then add a Web-Textbox to the WebPartZone
> Then I press F5, an ASP.NET development server shows up in my system tray
> and I see that IE is started, then after a while IE states that 'Internet
> Explorer cannot display the webpage', no ASP.NET error, nothing. After
> removing the WebPartManager and the WebPartZone, the page displays just
> fine
> (empty though), but no error in IE.
> I have no code in the default.aspx.vb.
> Any thoughts ? I must be missing a very simple something...
>
> Regards,
> Jurjen.
>