Showing posts with label missing. Show all posts
Showing posts with label missing. Show all posts

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/)

Thursday, March 22, 2012

Newbie Insert Question

I'm trying to build what I though was going to be a very easy page but I'm missing the boat here somewhere.

First Name: Textbox

Last Name: Textbox

Submit Button

How do I bind the textbox to a table? I've read this and that, played around with GridView enabled insert, delete and update to the table and it works fine but I just want what I have above.

I'm very new to this stuff so please talk to me like I'm two.

Thanx

When you say bind the textbox to a table what exactly do you mean? Do you want the textbox values to be shown in a hidden datagrid upon submit? or do you want the values inserted into a access/sql db upon submit? or something totally different?

let me know,
Stue


I want the values inserted in db upon submit.

Thanx


Heres a sample of my insert function:

Function InsertEvent(ByVal strEventIDAsString,ByVal strEventDescAsString,ByVal strEventContentIDAsString)

' Get "AppSettingName" from web.config(this has the db info ie table name, db, UN, PW, etc...that you entered)
Dim strConnAsString = ConfigurationManager.AppSettings("AppSettingName")

Dim sqlConnAs System.Data.SqlClient.SqlConnection =New System.Data.SqlClient.SqlConnection(strConn)

'Define your sql statement
Dim queryStringAsString ="INSERT INTO CMS_Log (User_Name, Event_ID, Date_Time, Description, Content_ID)" _

&"VALUES (@.User_Name, @.Event_ID, @.Date_Time, @.Description, @.Content_ID)"

Dim sqlCommandAs System.Data.SqlClient.SqlCommand =New System.Data.SqlClient.SqlCommand(queryString, sqlConn)

'Example of returning the value of a function for parameter "@.User_Name"
sqlCommand.Parameters.Add(

New System.Data.SqlClient.SqlParameter("@.User_Name", System.Data.SqlDbType.VarChar, 50,"User_Name")).Value = GetUserName()

'Example of returning the value of a string for parameter "@.Event_ID"
sqlCommand.Parameters.Add(

New System.Data.SqlClient.SqlParameter("@.Event_ID", System.Data.SqlDbType.Int, 4,"Event_ID")).Value = strEventID

'Example of returning the value todays date for parameter "@.Date_Time"
sqlCommand.Parameters.Add(

New System.Data.SqlClient.SqlParameter("@.Date_Time", System.Data.SqlDbType.SmallDateTime, 4,"Date_Time")).Value =Date.Now.ToString

'Example of returning the value of a textbox for parameter "@.Description"
sqlCommand.Parameters.Add(

New System.Data.SqlClient.SqlParameter("@.Description", System.Data.SqlDbType.VarChar, 50,"Description")).Value = tbDescription.text

sqlCommand.Parameters.Add(

New System.Data.SqlClient.SqlParameter("@.Content_ID", System.Data.SqlDbType.Int, 4,"Content_ID")).Value = strEventContentIDDim rowsAffectedAsInteger = 0

sqlConn.Open()

Try

rowsAffected = sqlCommand.ExecuteNonQuery

Finally

sqlConn.Close()

EndTryReturn rowsAffectedEndFunction

HTH,
Stue