
bkedersha
Members-
Posts
13 -
Joined
-
Last visited
bkedersha's Achievements
Newbie (1/14)
0
Reputation
-
I need to have an asp:checkbox place a "1", when it is checked, in a field in my sql server database or place a "0" when it is not checked. I started with this: Sub DoQuarterlyOverWrite(sender As Object, e As EventArgs) If Quaterly.Checked=true Then Quarterly.checked = "1" Else Quarterly.Checked = "0" End If End Sub I need to use this SQL insert because that is what the older developer used for this page. dim Cmd as new SQLCommand("InsertNewGrant",conn) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add("@GrantNumber", GrantNumber.Text.Trim()) cmd.Parameters.Add("@GrantProjectName", ProjectName.Text.Trim()) cmd.Parameters.Add("@CountryId", Country.SelectedItem.Value) cmd.Parameters.Add("@Description", 0) cmd.Parameters.Add("@CreateUserId", lblLoggedInAsId.text.Trim()) cmd.Parameters.Add("@UpdateUserId", 0) cmd.Parameters.Add("@ObligationDate", ObligationDate.SelectedDate) cmd.Parameters.Add("@OrigionalExpDate", CurrentExpirationDate.SelectedDate) cmd.Parameters.Add("@CurrentExpDate", CurrentExpirationDate.SelectedDate) cmd.Parameters.Add("@Terminated", 0) cmd.Parameters.Add("@Suspended", 0) cmd.Parameters.Add("@Locked", 0) cmd.Parameters.Add("@LockedByUserId", 0) cmd.Parameters.Add("@ACTNumber", 0) cmd.Parameters.Add("@GranteeName", GranteeName.Text.Trim()) cmd.Parameters.Add("@GranteeAddress1", AddressLine1.Text.Trim()) cmd.Parameters.Add("@GranteeAddress2", AddressLine2.Text.Trim()) cmd.Parameters.Add("@GranteeAddress3", AddressLine3.Text.Trim()) Cmd.connection.open() Cmd.ExecuteNonQuery() Cmd.connection.close() Help! :confused: :confused: :confused: :confused:
-
The previous developer used MS Frontpage 2003 to create this ASP website. He included in every page the strings to send data back and forth to SQL Server 2000. I am now creating some pages using Visual Studio 2005 Beta. I have a problem with the asp.net strings and webconfig. Does anyone know how to fix this problem without redoing any of the code in the pre-existing pages? There seems to be a conflict. When I have the script in webconfig for the VS pages to connect to SQL, the previous pages, made with Frontpage 2003, will not connect. When the script is not in, of course the VS pages will not work. The new config file <!-- Web.Config Configuration File --> <configuration> <connectionStrings> <add name="ADFGrantManagementConnectionString" connectionString="Data Source=ARIES;Initial Catalog=ADFGrantManagement;Persist Security Info=True;User ID=ADFWebUser;Password=adf" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <customErrors mode="Off"/> </system.web> </configuration> The old config file <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> :confused: :confused: :confused: :confused: :confused:
-
The previous developer used MS Frontpage 2003 to create this ASP website. He included in every page the strings to send data back and forth to SQL Server 2000. I am now creating some pages using Visual Studio 2005 Beta. I have a problem with the asp.net strings and webconfig. Does anyone know how to fix this problem without redoing any of the code in the pre-existing pages? There seems to be a conflict. When I have the script in webconfig for the VS pages to connect to SQL, the previous pages, made with Frontpage 2003, will not connect. When the script is not in, of course the VS pages will not work. :confused: :o
-
Record being picked up The previous developer created a checkbox page to confirm that a payment can be made. The user has to check off all the boxes before they can move on. The problem is when one user checks off all the boxes, and then leaves the record, another person could go to that record and not get the checkbox page again, as they should. Any ideas on how to reset this? :confused: :confused: :( :o
-
I am having a problem with multiple users on the pages. When one user logs out of the site, their connection to a particular record remains active and is picked up by another user going to that record. What is the best way to close all the connections and reset asp.net when a user leaves a record or logs out of the system? :confused: :confused: :confused: :confused: :(
-
Running a stored procedure in SQL Server 2000 I created a new stored procedure in SQL Server 2000. How do I get ASP.Net to run one or many stored procedures when a user clicks on a button? :confused: :confused:
-
Continuation of ' and " problem. The previous developer created and insert query for the save function. The function he created is below the error. Line 1: Incorrect syntax near 'uuu'. Unclosed quotation mark before the character string '''. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'uuu'. Unclosed quotation mark before the character string '''. Source Error: Line 136: dim Cmd as new SQLCommand(strSQL,conn) Line 137: Cmd.connection.open() Line 138: Cmd.ExecuteNonQuery() Line 139: Cmd.connection.close() Line 140: Source File: D:\GrantManagementWeb\GrantAddNew.aspx Line: 138 Stack Trace: [sqlException: Line 1: Incorrect syntax near 'uuu'. Unclosed quotation mark before the character string '''.] System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +180 ASP.GrantAddNew_aspx.ExeStatement(Object strSQL) in D:\GrantManagementWeb\GrantAddNew.aspx:138 ASP.GrantAddNew_aspx.dataSave_onClick(Object Sender, EventArgs e) in D:\GrantManagementWeb\GrantAddNew.aspx:128 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300 Sub dataSave_onClick(Sender as Object, e as EventArgs) 'Insert New Data dim i as integer dim booleanGO as boolean=true if not booleanGo then exit sub end if dim strSQL as string strSql = strSQL & "InsertNewGrant @GrantNumber =" & GrantNumber.text &", " strSQL = strSQL & "@GrantProjectName ='" & ProjectName.text & "'," strSQL = strSQL & "@CountryId ='" & Country.SelectedItem.value & "'," ' strSQL = strSQL & "@Description = null," ' strSQL = strSQL & "@CreateUserId = 0, " ' strSQL = strSQL & "@UpdateUserId = 0, " strSQL = strSQL & "@ObligationDate ='" & ObligationDate.SelectedDate.ToShortDateString & "', " strSQL = strSQL & "@OrigionalExpDate='" & CurrentExpirationDate.SelectedDate.ToShortDateString & "', " ' strSQL = strSQL & "@CurrentExpDate ='" & CurrentExpirationDate.SelectedDate.ToShortDateString & "', " ' strSQL = strSQL & "@Terminated =0," ' strSQL = strSQL & "@Suspended =0, " ' strSQL = strSQL & "@Locked =0, " ' strSQL = strSQL & "@LockedByUserId =0, " ' strSQL = strSQL & "@ACTNumber= null, " strSQL = strSQL & "@GranteeName ='" & GranteeName.text & "', " strSQL = strSQL & "@GranteeAddress1 ='" & AddressLine1.text & "'," strSQL = strSQL & "@GranteeAddress2 ='" & AddressLine2.text & "'," strSQL = strSQL & "@GranteeAddress3 ='" & AddressLine3.text & "'" ' strSQL = strSQL & "@ProgramId =null" ExeStatement(strSQL) response.write("RecordUpdated") response.redirect("GrantManagementWelcome.aspx") End Sub function ExeStatement(strSQL) dim Cmd as new SQLCommand(strSQL,conn) Cmd.connection.open() Cmd.ExecuteNonQuery() Cmd.connection.close() end function </script>
-
When I enter in aaa'aaa4"4aaa then try to excute the save query, I received the following error. I believe this is caused by the text sting going into the query text. Is there anyway around this error? Server Error in '/' Application. -------------------------------------------------------------------------------- Line 1: Incorrect syntax near 'aa1'. Unclosed quotation mark before the character string ''. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'aa1'. Unclosed quotation mark before the character string ''. Source Error: Line 136: dim Cmd as new SQLCommand(strSQL,conn) Line 137: Cmd.connection.open() Line 138: Cmd.ExecuteNonQuery() Line 139: Cmd.connection.close() Line 140: Source File: D:\GrantManagementWeb\GrantAddNew.aspx Line: 138 Stack Trace: [sqlException: Line 1: Incorrect syntax near 'aa1'. Unclosed quotation mark before the character string ''.] System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +180 ASP.GrantAddNew_aspx.ExeStatement(Object strSQL) in D:\GrantManagementWeb\GrantAddNew.aspx:138 ASP.GrantAddNew_aspx.dataSave_onClick(Object Sender, EventArgs e) in D:\GrantManagementWeb\GrantAddNew.aspx:128 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300 :confused: :confused:
-
GrandTotalUSDValue.text is blank because it has no values until a udget is entered GrandTotalUSDValue.text is blank. The user needs to enter in the first budget totals before the text box comes back with a value. :confused:
-
I have a new error on my page. I enter in a new grant, it does not have any budget data. When I click on the tab, this new error comes up. In the application, the user enters in a new Grant. There is in Budget data for the Grant. When a user selects the Budget tab, the page tries to retrieve the Grant's Budget data, but there is none in the table. The previous developer did not understand that with ASP.NET, you cannot get an empty record set. Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 42: conn.close() Line 43: lblCurrencyName.text = session("CurrencyName") Line 44: select case GrandTotalUSDValue.text > 250000 Line 45: case true Line 46: 'GrandTotalUSDValue.cssclass="ColorUp" Source File: D:\GrantManagementWeb\BudgetDataForm.aspx Line: 44 Stack Trace: [FormatException: Input string was not in a correct format.] Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +195 Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value, NumberFormatInfo NumberFormat) +84 [invalidCastException: Cast from string "" to type 'Double' is not valid.] Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value, NumberFormatInfo NumberFormat) +173 Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value) +7 ASP.BudgetDataForm_aspx.Page_Load(Object Sender, EventArgs e) in D:\GrantManagementWeb\BudgetDataForm.aspx:44 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750 :confused:
-
A previous developer created this page using FrontPage 2003. I know you cannot have an empty dataset. Is there anyway around this problem in VB.net and aspt.net http://www.xtremedotnettalk.com/newthread.php?do=newthread&f=62# Confused Operator is not valid for type 'DBNull' and type 'Date'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Operator is not valid for type 'DBNull' and type 'Date'. Source Error: Line 25: end select Line 26: if not page.ispostback Line 27: select case session("CurrentGrantExpDate") < now() Line 28: case true Line 29: lblNewExpDate.visible=false Source File: D:\GrantManagementWeb\TimeAmendmentForm.aspx Line: 27 Stack Trace: [invalidCastException: Operator is not valid for type 'DBNull' and type 'Date'.] Microsoft.VisualBasic.CompilerServices.ObjectType.ThrowNoValidOperator(Object obj1, Object obj2) +562 Microsoft.VisualBasic.CompilerServices.ObjectType.ObjTst(Object o1, Object o2, Boolean TextCompare) +2740 ASP.TimeAmendmentForm_aspx.Page_Load(Object Sender, EventArgs e) in D:\GrantManagementWeb\TimeAmendmentForm.aspx:27 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750 :confused: :confused: :confused:
-
Re: Operator is not valid for type 'DBNull' and type 'Date'. Did you find a way around this error? -={Brian Kedersha}=- :confused: