
macupryk
Members-
Posts
23 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by macupryk
-
I have two files in visual source safe one with global.asa and the other global.asax,global.asax.res, global.asax.vb. The global.asa contains the following: <SCRIPT LANGUAGE=VBScript RUNAT=Server> ' C.C. Financial Evaluation Model global.asa ' Copyright 2001 Zurich North America ' Corporate Customer 'You can add special event handlers in this file that will get run automatically when 'special Active Server Pages events occur. To create these handlers, just create a 'subroutine with a name from the list below that corresponds to the event you want to 'use. For example, to create an event handler for Session_OnStart, you would put the 'following code into this file (without the comments): 'Sub Session_OnStart '**Put your code here ' '** 'End Sub 'EventName Description 'Session_OnStart Runs the first time a user runs any page in your application 'Session_OnEnd Runs when a user's session times out or quits your application 'Application_OnStart Runs once when the first page of your application is run for the first time by any user 'Application_OnEnd Runs once when the web server shuts down Dim aDBParams() Dim aEntParams() Dim sRegSetting Dim objRegRead Dim nParamCnt Dim nEntCnt Dim nLoopCnt Function ParseString (SubStrs, argSrcStr, Delimiter ) ' Dimension variables: ReDim SubStrs(0) Dim CurPos Dim NextPos Dim DelLen Dim nCount Dim TStr Dim SrcStr ' Add delimiters to start and end of string to make loop simpler: SrcStr=argSrcStr SrcStr = Delimiter & SrcStr & Delimiter ' Calculate the delimiter length only once: DelLen = Len(Delimiter) ' Initialize the count and position: nCount = 0 CurPos = 1 NextPos = InStr(CurPos + DelLen, SrcStr, Delimiter) ' Loop searching for delimiters: Do Until NextPos = 0 ' Extract a sub-string: TStr = Mid(SrcStr, CurPos + DelLen, NextPos - CurPos - DelLen) ' Increment the sub string counter: nCount = nCount + 1 ' Add room for the new sub-string in the array: ReDim Preserve SubStrs(nCount) ' Put the sub-string in the array: SubStrs(nCount) = Trim(TStr) ' Position to the last found delimiter: CurPos = NextPos ' Find the next delimiter: NextPos = InStr(CurPos + DelLen, SrcStr, Delimiter) Loop ' Return the number of sub-strings found: ParseString = nCount End Function ' Use Application variables since they do not change from session to session Sub application_OnStart() Dim sDBParams() Dim sEntParms() Dim sRegSetting Dim objRegRd Dim nParmCnt Dim nEntCnt Dim nLoopCnt Application.Lock ' =========> ChannelZ Home page <================= 'Development Server application("ChannelZSvr") = "http://chzdev.zurichna.com" 'Staging Server 'application("ChannelZSvr") = "http://chzstaging.zurichna.com" 'Prod Server 'application("ChannelZSvr") = "http://chz.zurichna.com" ' =========> IIS Home page <================= 'Dev Server application("IISHomeURL") = "http://chzdev.zurichna.com" 'Staging Server '*application("IISHomeURL") = "http://chzstaging.zurichna.com" 'Prod Server '*application("IISHomeURL") = "http://chz.zurichna.com" ' =========> Enterprise Risk Home page <================= 'Dev Server application("Ent_Risk_Home") = "http://zaiadev.zurichna.com" '' application("Ent_Risk_Home") = "http://172.16.232.73:9030" Cutover 'Staging Server 'application("Ent_Risk_Home") = "http://zuserstg.zurichna.com" 'Prod Server 'application("Ent_Risk_Home") = "http://zuser.zurichna.com" ' =========> Enterprise Risk WEB Paths used by Financial Model <================= '--> Applications Home Page Application("applications_home_page_path") = "corporate_customer/applications" '--> Financial Model directory structure Application("financial_model_path") = "corporate_customer/applications/financial_evaluation_model" Application.Unlock ' =========> Enterprise Risk Application Variables used by Financial Evaluation Model <================= ' =========> These are used by the reporting section <================= ' the following applications variables are initialized from the registry of the server 'DataBase Server Name = Application("Data Source") 'DataBase Name = Application("Initial Catalog") 'userid for reporting = Application("User Id") 'Password for reporting userid = Application("Password") ' see file regcom.reg for setup of registry entry set objRegRead = server.CreateObject("ZUSER_FinMRdRegKy.clReadReg") sRegSetting = objRegRead.ReadReg("ZUSER_FinM","Database","Connect") nParamCnt = ParseString(aDBParams,sRegSetting,";") for nLoopCnt = 1 to nParamCnt -1 step 1 nEntCnt = ParseString(aEntParams,aDBParams(nLoopCnt),"=") if nEntCnt = 2 then Application.Lock Application(aEntParams(1))= aEntParams(2) Application.Unlock end if next sRegSetting = objRegRead.ReadReg("ZUSER_FinM","Database","ReportsDSN") set pobjRegRead = Nothing nParamCnt = ParseString(aDBParams,sRegSetting,";") for nLoopCnt = 1 to nParamCnt -1 step 1 nEntCnt = ParseString(aEntParams,aDBParams(nLoopCnt),"=") if nEntCnt = 2 then Application.Lock Application(aEntParams(1))= aEntParams(2) Application.Unlock end if next ' =========> Domino Web servers <================= 'Dev Server Application.Lock application("DominoHomeURL") = "http://usznalpha2.zurichna.com" 'Staging Server 'application("DominoHomeURL") = "http://usznbeta2.zurichna.com" 'Production Server 'application("DominoHomeURL") = "http://usznweb2.zurichna.com" Application.Unlock End Sub </SCRIPT> and this is the global.asax.vb: ===================== Imports System.Web Imports System.Web.SessionState Imports clsRegistryRead Public Class Global Inherits System.Web.HttpApplication #Region " Component Designer Generated Code " Public Sub New() MyBase.New() 'This call is required by the Component Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Required by the Component Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Component Designer 'It can be modified using the Component Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() components = New System.ComponentModel.Container() End Sub #End Region Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the application is started Dim rReg As New clsRegistryRead.FinMod_RegistryReader() Application("ConnectString") = rReg.GetCurrUserRegistryValue(".Default\Software\VB and VBA Program Settings\ZUSER_FinM\Database", "Connect") End Sub Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the session is started End Sub Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires at the beginning of each request End Sub Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires upon attempting to authenticate the use End Sub Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Fires when an error occurs End Sub Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the session ends End Sub Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the application ends End Sub End Class Which one is being run when the default.asp page is being loaded?
-
I have the following: Case 12 'print PrintDialog1.Document = ThePrintDocument Dim strText As String = Me.txtComments.Text myReader = New StringReader(strText) If PrintDialog1.ShowDialog() = DialogResult.OK Then Me.ThePrintDocument.Print() End If I need a sub routine for printing different fonts (sizes), underline, bold. Private Sub ThePrintDocument_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles ThePrintDocument.PrintPage
-
Microsoft VBScript runtime error '800a01f4' Variable is undefined: 'NO_ACCESS' /eis/Includes/EISGetUser.inc, line 41 Any help would be great , thanks Mat
-
I get this error, the update was automatically done this morning, how can I see the last updates or remove them: The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed. -------------------------------------------------------------------------------- Please try the following: Open the zuser.zurichna.com home page, and then look for links to the information you want. Click the Refresh button, or try again later. Click Search to look for information on the Internet. You can also see a list of related sites. HTTP 500 - Internal server error Internet Explorer
-
:-\ I have the following with an ado.net routine called. Public Sub DoModify() Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember) Dim dr As DataRow = CType(bm.Current, DataRowView).Row Dim editform As New EditTransOverride(dr) oldPolicyNumber = dr.Item(1) oldTransCode = dr.Item(2) oldTransEffDate = dr.Item(3) Dim retval As DialogResult = editform.ShowDialog() If retval = DialogResult.OK Then bm.EndCurrentEdit() Try Dim substr As String = dr.Item(4) If substr Is System.DBNull.Value Then substr = "" End If If Not substr = "" Then substr = substr.Substring(0, 2) End If ExecOnTransOverride.upd(dr.Item(1), dr.Item(2), dr.Item(3), substr, dr.Item(5), _ dr.Item(6), dr.Item(8), dr.Item(7), DateTime.Now, dr.Item(7), _ dr.Item(9), oldPolicyNumber, oldTransCode, oldTransEffDate) SqlDataAdapter1.Update(ds, "DsTransOverride1") ds.Tables("DsTransOverride1").AcceptChanges() MsgBox("Data Inserted Successfully !", MsgBoxStyle.Information, Me.Text) Catch se As SqlException MessageBox.Show(se.Message) Catch ex As Exception MessageBox.Show(ex.Message) End Try Else bm.CancelCurrentEdit() End If End Sub Now I would like to update the datagrid with the use of the SqlDataAdapter1.Update(ds, "DsTransOverride1") ds.Tables("DsTransOverride1").AcceptChanges() and use my ado.net routine since I tested it and it works and updates the database. The only thing I need to do in the above routine is to update the datagrid. How do I go about doing this?
-
I have the following procedure SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO /* ------------------------------------------------------------ PROCEDURE: dbo.prc_TransOverride_upd Description: Updates a record In table 'dbo.prc_TransOverride_upd' ------------------------------------------------------------ */ CREATE PROCEDURE dbo.prc_TransOverride_upd ( @Policy_Nbr varchar(7), @Trans_CodeOrig varchar(6), @Trans_Eff_Date datetime, @Override_Code varchar(2), @NR_CodeOvr varchar(1), @Trans_CodeOvr varchar(6), @CreatedDate datetime, @CreatedUID nvarchar(48), @ModifiedDate datetime, @ModifiedUID nvarchar(48), @Plan_Year int ) As BEGIN DECLARE @Err Int UPDATE [TransOverride] Set [Policy_Nbr] = @Policy_Nbr, [Trans_CodeOrig] = @Trans_CodeOrig, [Trans_Eff_Date] = @Trans_Eff_Date, [Override_Code] = @Override_Code, [NR_CodeOvr] = @NR_CodeOvr, [Trans_CodeOvr] = @Trans_CodeOvr, [CreatedDate] = @CreatedDate, [CreatedUID] = @CreatedUID, [ModifiedDate] = @ModifiedDate, [ModifiedUID] = @ModifiedUID, [Plan_Year] = @Plan_Year WHERE [Policy_Nbr] = @Policy_Nbr AND [Trans_CodeOrig] = @Trans_CodeOrig AND [Trans_Eff_Date] = @Trans_Eff_Date Set @Err = @@Error RETURN @Err End GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO With this in mind I have, where I have to keed the old values oldPolicyNumber = dr.Item(1) oldTransCode = dr.Item(2) oldTransEffDate = dr.Item(3) before they are modified in a diolog form. Then I must do an update that requires the old values in the where clause. Now see the question below. Public Sub DoModify() Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember) Dim dr As DataRow = CType(bm.Current, DataRowView).Row Dim editform As New EditTransOverride(dr) oldPolicyNumber = dr.Item(1) oldTransCode = dr.Item(2) oldTransEffDate = dr.Item(3) Dim retval As DialogResult = editform.ShowDialog() If retval = DialogResult.OK Then bm.EndCurrentEdit() Try Dim substr As String = dr.Item(4) substr = substr.Substring(0, 2) ExecOnTransOverride.upd(dr.Item(1), dr.Item(2), dr.Item(3), dr.Item(4), dr.Item(5), dr.Item(6), dr.Item(8), dr.Item(7), DateTime.Now, dr.Item(7), dr.Item(9), oldPolicyNumber, oldTransCode, oldTransEffDate) SqlDataAdapter1.Update(ds, "DsTransOverride1") ds.Tables("DsTransOverride1").AcceptChanges() MsgBox("Data Inserted Successfully !", MsgBoxStyle.Information, Me.Text) Catch se As SqlException MessageBox.Show(se.Message) Catch ex As Exception MessageBox.Show(ex.Message) End Try Else bm.CancelCurrentEdit() End If End Sub Now I have the following ado.net code that first I must add the three paramaters in strPolicy_Nbr_old As Object, strTrans_CodeOrig_old As Object, dteTrans_Eff_Date_old As Object in the subroutine with the appropriate direction and modify the stored procedure to work with this. Public Shared Function upd( _ ByVal strPolicy_Nbr As Object, _ ByVal strTrans_CodeOrig As Object, _ ByVal dteTrans_Eff_Date As Object, _ ByVal varOverride_Code As Object, _ ByVal varNR_CodeOvr As Object, _ ByVal varTrans_CodeOvr As Object, _ ByVal dteCreatedDate As Object, _ ByVal strCreatedUID As Object, _ ByVal dteModifiedDate As Object, _ ByVal varModifiedUID As Object, _ ByVal lngPlan_Year As Object, _ ByVal strPolicy_Nbr_old As Object, _ ByVal strTrans_CodeOrig_old As Object, _ ByVal dteTrans_Eff_Date_old As Object _ ) As Object ' construct new connection And command objects Dim conn As SqlConnection = GetConn() Dim cmd As SqlCommand = GetSprocCmd("prc_TransOverride_upd", conn) Dim param As SqlParameter ' add return value param param = New SqlParameter("@RETURN_VALUE", SqlDbType.Int) param.Direction = ParameterDirection.ReturnValue cmd.Parameters.Add(param) ' add params ' parameter for Policy_Nbr column param = New SqlParameter("@Policy_Nbr", System.Data.SqlDbType.VarChar, 7) param.Direction = ParameterDirection.Input param.Value = strPolicy_Nbr cmd.Parameters.Add(param) ' parameter for Trans_CodeOrig column param = New SqlParameter("@Trans_CodeOrig", System.Data.SqlDbType.VarChar, 6) param.Direction = ParameterDirection.Input param.Value = strTrans_CodeOrig cmd.Parameters.Add(param) ' parameter for Trans_Eff_Date column param = New SqlParameter("@Trans_Eff_Date", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteTrans_Eff_Date cmd.Parameters.Add(param) ' parameter for Override_Code column param = New SqlParameter("@Override_Code", System.Data.SqlDbType.VarChar, 2) param.Direction = ParameterDirection.Input param.Value = varOverride_Code cmd.Parameters.Add(param) ' parameter for NR_CodeOvr column param = New SqlParameter("@NR_CodeOvr", System.Data.SqlDbType.VarChar, 1) param.Direction = ParameterDirection.Input param.Value = varNR_CodeOvr cmd.Parameters.Add(param) ' parameter for Trans_CodeOvr column param = New SqlParameter("@Trans_CodeOvr", System.Data.SqlDbType.VarChar, 6) param.Direction = ParameterDirection.Input param.Value = varTrans_CodeOvr cmd.Parameters.Add(param) ' parameter for CreatedDate column param = New SqlParameter("@CreatedDate", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteCreatedDate cmd.Parameters.Add(param) ' parameter for CreatedUID column param = New SqlParameter("@CreatedUID", System.Data.SqlDbType.NVarChar, 48) param.Direction = ParameterDirection.Input param.Value = strCreatedUID cmd.Parameters.Add(param) ' parameter for ModifiedDate column param = New SqlParameter("@ModifiedDate", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteModifiedDate cmd.Parameters.Add(param) ' parameter for ModifiedUID column param = New SqlParameter("@ModifiedUID", System.Data.SqlDbType.NVarChar, 48) param.Direction = ParameterDirection.Input param.Value = varModifiedUID cmd.Parameters.Add(param) ' parameter for Plan_Year column param = New SqlParameter("@Plan_Year", System.Data.SqlDbType.Int, 4) param.Direction = ParameterDirection.Input param.Value = lngPlan_Year cmd.Parameters.Add(param) ' open connection conn.Open() ' Execute command cmd.ExecuteNonQuery() ' get return value Dim result As Integer = GetSProcReturnValue(cmd) ' close connection conn.Close() Return result End Function Here is the stored procedure: SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO /* ------------------------------------------------------------ PROCEDURE: dbo.prc_TransOverride_upd Description: Updates a record In table 'dbo.prc_TransOverride_upd' ------------------------------------------------------------ */ CREATE PROCEDURE dbo.prc_TransOverride_upd ( @Policy_Nbr varchar(7), @Trans_CodeOrig varchar(6), @Trans_Eff_Date datetime, @Override_Code varchar(2), @NR_CodeOvr varchar(1), @Trans_CodeOvr varchar(6), @CreatedDate datetime, @CreatedUID nvarchar(48), @ModifiedDate datetime, @ModifiedUID nvarchar(48), @Plan_Year int ) As BEGIN DECLARE @Err Int UPDATE [TransOverride] Set [Policy_Nbr] = @Policy_Nbr, [Trans_CodeOrig] = @Trans_CodeOrig, [Trans_Eff_Date] = @Trans_Eff_Date, [Override_Code] = @Override_Code, [NR_CodeOvr] = @NR_CodeOvr, [Trans_CodeOvr] = @Trans_CodeOvr, [CreatedDate] = @CreatedDate, [CreatedUID] = @CreatedUID, [ModifiedDate] = @ModifiedDate, [ModifiedUID] = @ModifiedUID, [Plan_Year] = @Plan_Year WHERE [Policy_Nbr] = @Policy_Nbr AND [Trans_CodeOrig] = @Trans_CodeOrig AND [Trans_Eff_Date] = @Trans_Eff_Date Set @Err = @@Error RETURN @Err End GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO I think I should add something like this in my ado.net ' The addition of three ' add params ' parameter for Policy_Nbr column param = New SqlParameter("@Policy_Nbr_Old", System.Data.SqlDbType.VarChar, 7) param.Direction = ParameterDirection.Input param.Value = strPolicy_Nbr_old cmd.Parameters.Add(param) ' parameter for Trans_CodeOrig column param = New SqlParameter("@Trans_CodeOrig_Old", System.Data.SqlDbType.VarChar, 6) param.Direction = ParameterDirection.Input param.Value = strTrans_CodeOrig_old cmd.Parameters.Add(param) ' parameter for Trans_Eff_Date column param = New SqlParameter("@Trans_Eff_Date_Old", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteTrans_Eff_Date_old cmd.Parameters.Add(param) and then I will have to add these to my stored procedure. I know it is a long question but any help would be well acknowledge.
-
Is there something I can do the application is working fine one another server. When I try to run it on this one. I get the following: Server Error in '/corporate_customer/applications/CISS' Application. -------------------------------------------------------------------------------- COM object with CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} is either not valid or not registered. 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.Runtime.InteropServices.COMException: COM object with CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} is either not valid or not registered. Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a "Debug=true" directive at the top of the file that generated the error. Example: <%@ Page Language="C#" Debug="true" %> or: 2) Add the following section to the configuration file of your application: <configuration> <system.web> <compilation debug="true"/> </system.web> </configuration> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. Stack Trace: [COMException (0x80040154): COM object with CLSID {CF76A644-314B-404D-8D45-F08B51FF990B} is either not valid or not registered.] CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +11 [TypeInitializationException: The type initializer for "CrystalDecisions.CrystalReports.Engine.ReportDocument" threw an exception.] CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0 CISS.CISSViewer..cctor() in Y:\CISSViewer.aspx.vb:19 [TypeInitializationException: The type initializer for "CISS.CISSViewer" threw an exception.] CISS.CISSViewer..ctor() +0 ASP.CISSViewer_aspx..ctor() [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0 System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +164 [HttpException (0x80004005): Failed to create page of type 'ASP.CISSViewer_aspx'.] System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +340 System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String virtualPath, String inputFile, HttpContext context) +43 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +44 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +698 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +95 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173
-
I need to remove the prefix(domain name) if exist in front of a username from a session variable. paramsql.Value = Session("ssNtUser") say the domain is za username is macupryk I would like to remove the za\ so in the session variable I have macupryk only but the domain name can change. Also there might not even be a domain name with a slash. Thanks.
-
I need to view variables or trace I am having problems debugging over a server I need to look at the following: Response.Write(Session("ssUserName")) Response.Write(Session("ssUserAuthority")) Response.Write(Session("ssUserBU")) Response.Write(Session("ssNtUser")) ch = getch() pause here I am not sure how to do this in vb.net. also should I use Response.Write to trace my variables? Any help would be appreciated. Thanks.
-
click on modify button? Public Sub DoModify() Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember) ===>>> Dim dr As DataRow = CType(bm.Current, DataRowView).Row <<<=== Dim editform As New EditTransOverride(dr) Dim retval As DialogResult = editform.ShowDialog() If retval = DialogResult.OK Then bm.EndCurrentEdit() Try Dim substr As String = dr.Item(4) substr = substr.Substring(0, 2) ExecOnTransOverride.upd(dr.Item(1), dr.Item(2), dr.Item(3), dr.Item(4), dr.Item(5), dr.Item(6), dr.Item(8), dr.Item(7), DateTime.Now, dr.Item(7), dr.Item(9)) SqlDataAdapter1.Update(ds, "DsTransOverride1") ds.Tables("DsTransOverride1").AcceptChanges() MsgBox("Data Inserted Successfully !", MsgBoxStyle.Information, Me.Text) Catch se As SqlException MessageBox.Show(se.Message) Catch ex As Exception MessageBox.Show(ex.Message) End Try Else bm.CancelCurrentEdit() End If End Sub An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.windows.forms.dll Additional information: No value at index -1. I get an error ===>>> Dim dr As DataRow = CType(bm.Current, DataRowView).Row <<<=== What is going on?
-
If you want to insert DON'T do this Dim dr As DataRow = CType(bm.Current, DataRowView).Row Dim addform As New AddTransOverride(dr) Dim retval As DialogResult = addform.ShowDialog() the above will modify the current row you are on, but do somethiing like this Dim dr As DataRow = bm.addnew 'or bm.new I don't have vs on this machine so I can't check Dim addform As New AddTransOverride(dr) Dim retval As DialogResult = addform.ShowDialog()
-
Insert Statement Conflict Column Check Constraint
macupryk replied to macupryk's topic in Database / XML / Reporting
Pass a two character How do I pass a two character for dr.Item(4) in the following: ExecOnTransOverride.ins(dr.Item(1), dr.Item(2), dr.Item(3), dr.Item(4), dr.Item(5), dr.Item(6), dr.Item(8), dr.Item(7), DateTime.Now, dr.Item(7), dr.Item(9)) + dr.Item(1) "1234555" {String} Object + dr.Item(2) "CANADJ" {String} Object + dr.Item(3) #9/22/2005# {Date} Object + dr.Item(4) "ACCOUNT" {String} Object + dr.Item(5) "N" {String} Object + dr.Item(6) "COMMCH" {String} Object + dr.Item(7) "za\mmmmmm" {String} Object + dr.Item(8) #8/28/2005 10:58:13 PM# {Date} Object + dr.Item(9) 2222 {Integer} Object I am getting this error http://www.vbcity.com/forums/topic.asp?tid=111180 Insert Statement Conflict Column Check Constraint CREATE TABLE [TransOverride] ( [Policy_Nbr] [varchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Trans_CodeOrig] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Trans_Eff_Date] [datetime] NOT NULL , [Override_Code] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [NR_CodeOvr] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Trans_CodeOvr] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [CreatedDate] [datetime] NOT NULL CONSTRAINT [DF__TransOver__Creat__70A8B9AE] DEFAULT (getdate()), [CreatedUID] [nvarchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF__TransOver__Modif__719CDDE7] DEFAULT (getdate()), [ModifiedUID] [nvarchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Plan_Year] [int] NOT NULL CONSTRAINT [DF__TransOver__Plan___56757D0D] DEFAULT (2004), CONSTRAINT [cnTransOverride_PK] PRIMARY KEY CLUSTERED ( [Policy_Nbr], [Trans_CodeOrig], [Trans_Eff_Date] ) ON [PRIMARY] , CONSTRAINT [cnTransOverride_NR_CodeOvr_CK] CHECK ([NR_CodeOvr] = '' or ([NR_CodeOvr] = 'R' or [NR_CodeOvr] = 'N')), CONSTRAINT [cnTransOverride_Override_Code_CK] CHECK ([Override_Code] = '' or ([Override_Code] = 'OT' or ([Override_Code] = 'AU' or ([Override_Code] = 'MS' or ([Override_Code] = 'EN' or ([Override_Code] = 'AO' or [Override_Code] = 'AC')))))) ) ON [PRIMARY] GO -
This is my insert sub routine. Public Sub DoAddnew() Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember) Dim dr As DataRow = CType(bm.Current, DataRowView).Row Dim addform As New AddTransOverride(dr) Dim retval As DialogResult = addform.ShowDialog() If retval = DialogResult.OK Then bm.EndCurrentEdit() Try ExecOnTransOverride.ins(dr.Item(1), dr.Item(2), dr.Item(3), dr.Item(4), dr.Item(5), dr.Item(6), dr.Item(8), dr.Item(7), DateTime.Now, dr.Item(7), dr.Item(9)) SqlDataAdapter1.Update(ds, "DsTransOverride1") ds.Tables("DsTransOverride1").AcceptChanges() MsgBox("Data Inserted Successfully !", MsgBoxStyle.Information, Me.Text) Catch se As SqlException MessageBox.Show(se.Message) Catch ex As Exception MessageBox.Show(ex.Message) End Try Else bm.CancelCurrentEdit() End If End Sub Public Shared Function ins( _ ByVal strPolicy_Nbr As Object, _ ByVal strTrans_CodeOrig As Object, _ ByVal dteTrans_Eff_Date As Object, _ ByVal varOverride_Code As Object, _ ByVal varNR_CodeOvr As Object, _ ByVal varTrans_CodeOvr As Object, _ ByVal dteCreatedDate As Object, _ ByVal strCreatedUID As Object, _ ByVal dteModifiedDate As Object, _ ByVal varModifiedUID As Object, _ ByVal lngPlan_Year As Object _ ) As Integer ' construct new connection And command objects Dim conn As SqlConnection = GetConn() Dim cmd As SqlCommand = GetSprocCmd("prc_TransOverride_ins", conn) Dim param As SqlParameter ' Add return value param param = New SqlParameter("@RETURN_VALUE", SqlDbType.Int) param.Direction = ParameterDirection.ReturnValue cmd.Parameters.Add(param) ' Add params ' parameter for Policy_Nbr column param = New SqlParameter("@Policy_Nbr", System.Data.SqlDbType.VarChar, 7) param.Direction = ParameterDirection.Input param.Value = strPolicy_Nbr cmd.Parameters.Add(param) ' parameter for Trans_CodeOrig column param = New SqlParameter("@Trans_CodeOrig", System.Data.SqlDbType.VarChar, 6) param.Direction = ParameterDirection.Input param.Value = strTrans_CodeOrig cmd.Parameters.Add(param) ' parameter for Trans_Eff_Date column param = New SqlParameter("@Trans_Eff_Date", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteTrans_Eff_Date cmd.Parameters.Add(param) ' parameter for Override_Code column param = New SqlParameter("@Override_Code", System.Data.SqlDbType.VarChar, 2) param.Direction = ParameterDirection.Input param.Value = varOverride_Code cmd.Parameters.Add(param) ' parameter for NR_CodeOvr column param = New SqlParameter("@NR_CodeOvr", System.Data.SqlDbType.VarChar, 1) param.Direction = ParameterDirection.Input param.Value = varNR_CodeOvr cmd.Parameters.Add(param) ' parameter for Trans_CodeOvr column param = New SqlParameter("@Trans_CodeOvr", System.Data.SqlDbType.VarChar, 6) param.Direction = ParameterDirection.Input param.Value = varTrans_CodeOvr cmd.Parameters.Add(param) ' parameter for CreatedDate column param = New SqlParameter("@CreatedDate", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteCreatedDate cmd.Parameters.Add(param) ' parameter for CreatedUID column param = New SqlParameter("@CreatedUID", System.Data.SqlDbType.NVarChar, 48) param.Direction = ParameterDirection.Input param.Value = strCreatedUID cmd.Parameters.Add(param) ' parameter for ModifiedDate column param = New SqlParameter("@ModifiedDate", System.Data.SqlDbType.DateTime, 8) param.Direction = ParameterDirection.Input param.Value = dteModifiedDate cmd.Parameters.Add(param) ' parameter for ModifiedUID column param = New SqlParameter("@ModifiedUID", System.Data.SqlDbType.NVarChar, 48) param.Direction = ParameterDirection.Input param.Value = varModifiedUID cmd.Parameters.Add(param) ' parameter for Plan_Year column param = New SqlParameter("@Plan_Year", System.Data.SqlDbType.Int, 4) param.Direction = ParameterDirection.Input param.Value = lngPlan_Year cmd.Parameters.Add(param) ' open connection conn.Open() ' Execute command cmd.ExecuteNonQuery() ' get return value Dim result As Integer = GetSProcReturnValue(cmd) ' close connection conn.Close() Return result End Function Can someone help me out with this Thanks, Matt
-
When I am in Debug mode, I want to set the value of the textbox on the dialog form. What happens the dialog form appears before , even when I am starting debug bug mode. The values of the textbox in show dialog sub routine they appear to be set in an empty string. How ever this does not occur such that the dialog for populates with aparent values. When not in tracing mode. Why do I get this problem? Here is the function===: Public Overloads Sub ShowDialog(ByRef objTransoverride As TransOverride.structTransoverride) ' ' Do All the work that you want to i.e. the one that you have written in the Load ' ' oldPolicyNumber = objTransoverride.PolicyNumber.ToString() oldTransCode = objTransoverride.TransCodeOrig.ToString() oldTransEffDate = objTransoverride.TransEffDate.ToString() txtAccountName.Text = objTransoverride.Account_Name.ToString() txtPolicyNumber.Text = objTransoverride.PolicyNumber.ToString() txtPlanYear.Text = objTransoverride.Plan_Year.ToString() txtUserId.Text = objTransoverride.ModifiedUID.ToString() txtDate.Text = objTransoverride.ModifiedDate.ToString() lbRecNum.Text = objTransoverride lbRecNum.Text = objTransoverride.RowNum.ToString() DateTimePicker1.Text = objTransoverride.TransEffDate.ToString() DateTimePicker1.Value = objTransoverride.TransEffDate.ToString() FillComboBocmbOriginalTransCode, objTransoverride.TransCodeOrig) FillComboBocmbOverrideAction, objTransoverride.Override_Action) FillComboBocmbOverrideNR, objTransoverride.Override_New_Renewal) FillComboBocmbOverrideTransactionCode, objTransoverride.Override_Transaction_Code) MyBase.ShowDialog() End Sub
-
I have the error coming when I call a dialog form passing a parameter. An unhandled exception of type 'System.Exception' occurred in microsoft.visualbasic.dll Additional information: Can't assign text to readonly, disabled or hidden C1Input control when its Text property is not detached. Public Sub DoModify() Dim dTable As DataTable = Me.DataGrid1.DataSource Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember) Dim dRow As DataRow = CType(bm.Current, DataRowView).Row Me.lbNumRec.Text = Me.DsTransOverride1.Tables(0).Rows.Count.ToString() Dim cEditTransOverride As New EditTransOverride cEditTransOverride.ShowDialog(TransOverrideStruct) ====> Fails here Me.DsTransOverride1.Tables(0).Clear() Me.SqlDataAdapter1.Fill(Me.DsTransOverride1) Me.DataGrid1.Refresh() End Sub Public Class EditTransOverride Inherits System.Windows.Forms.Form 'Dim TOverride As New TransOverride.structTransoverride #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Public Overloads Sub ShowDialog(ByRef objTransoverride As TransOverride.structTransoverride) ' ' Do All the work that you want to i.e. the one that you have written in the Load ' ' oldPolicyNumber = objTransoverride.PolicyNumber.ToString() oldTransCode = objTransoverride.TransCodeOrig.ToString() oldTransEffDate = objTransoverride.TransEffDate.ToString() txtAccountName.Text = objTransoverride.Account_Name.ToString() txtPolicyNumber.Text = objTransoverride.PolicyNumber.ToString() txtPlanYear.Text = objTransoverride.Plan_Year.ToString() txtUserId.Text = objTransoverride.ModifiedUID.ToString() txtDate.Text = objTransoverride.ModifiedDate.ToString() dteEffDt.Text = objTransoverride.TransEffDate.ToString() dteEffDt.Value = objTransoverride.TransEffDate.ToString() lbRecNum.Text = objTransoverride.RowNum.ToString() FillComboBox(cmbOriginalTransCode, objTransoverride.TransCodeOrig) FillComboBox(cmbOverrideAction, objTransoverride.Override_Action) FillComboBox(cmbOverrideNR, objTransoverride.Override_New_Renewal) FillComboBox(cmbOverrideTransactionCode, objTransoverride.Override_Transaction_Code) MyBase.ShowDialog() End Sub
-
I have a stored procedure and it is not saving the values in the table. How can I view that the stored procedure is saving the values. Private Sub DoSave() Dim ConnectionString As String = System.Configuration.ConfigurationSettings.AppSettings("FinSolMainDBConn") Dim connfinsol As New System.Data.SqlClient.SqlConnection(ConnectionString) Dim strsql As String Dim adapter As New SqlDataAdapter Dim transaction As SqlTransaction Dim myCommand As New SqlCommand("stp_UpdTransOverride ", connfinsol) myCommand.CommandType = CommandType.StoredProcedure 'Add Parameters ' 1 Policy Number myCommand.Parameters.Add("@Policy_Nbr", SqlDbType.VarChar, 7).Value = txtPolicyNumber.Text ' 2 Original Tranaction Override myCommand.Parameters.Add("@Trans_CodeOrig", SqlDbType.VarChar, 6).Value = cmbOriginalTransCode.Text ' 3 Transaction Effective Date myCommand.Parameters.Add("@Trans_Eff_Date", SqlDbType.DateTime, 8).Value = dteEffDt.Value ' 4 Override Action myCommand.Parameters.Add("@Override_Code", SqlDbType.VarChar, 2).Value = cmbOverrideAction.Text ' 5 Override New/Renewal myCommand.Parameters.Add("@NR_CodeOvr", SqlDbType.VarChar, 1).Value = cmbOverrideNR.Text ' 6 Override Transaction Code myCommand.Parameters.Add("@Trans_CodeOvr", SqlDbType.VarChar, 6).Value = cmbOverrideTransactionCode.Text ' 7 Modified UID myCommand.Parameters.Add("@ModifiedUID", SqlDbType.NVarChar, 48).Value = txtUserId.Text ' 8 Plan Year myCommand.Parameters.Add("@Plan_Year", SqlDbType.Int, 4).Value = txtPlanYear.Text 'Open Connection Try 'Open Connection connfinsol.Open() myCommand.ExecuteNonQuery() MsgBox("Data Saved Successfully !", MsgBoxStyle.Information, Me.Text) Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, Me.Text) Finally If myCommand.Connection.State = ConnectionState.Open Then myCommand.Connection.Close() End If End Try End Sub
-
Values of textbox are not being saved in the following routine: Function FillTextBox(ByRef TextBox As TextBox, ByVal Value As Object) If Not IsDBNull(Value) Then TextBox.Text = Value Else TextBox.Text = "" End If End Function Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Poluate text box. FillTextBox(txtAccountName, TOverride.Account_Name) FillTextBox(txtPolicyNumber, TOverride.PolicyNumber) FillTextBox(txtUserId, TOverride.ModifiedUID) End Sub
-
I have the following two pages. I am wondering how can I return back. When I click on the back link to go to page one I want the values to be saved or in the textboxes. What is the appropriate way in visual studio 2005? CrossPage1.aspx =============== <%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div align="center"> <table> <tr> <td>Enter some Text:</td> <td><asp:TextBox ID="TextBox1" Runat="server"></asp:TextBox></td> </tr> <tr> <td>Enter more Text:</td> <td><asp:TextBox ID="TextBox2" Runat="server"></asp:TextBox></td> </tr> <tr> <td align="center" colspan="2"> <asp:LinkButton ID="LinkButton1" Runat="server" PostBackUrl="CrossPage2.aspx">Submit Page</asp:LinkButton> </td> </tr> </table> </div> </form> </body> </html> CrossPage2.aspx =============== <%@ Page Language="C#" %> <%@ PreviousPageType VirtualPath="CrossPage1.aspx" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <script runat="server"> void Page_Load(object sender, System.EventArgs e) { // If posted from CrossPage1.aspx to CrossPage2.aspx... if (PreviousPage == null) { Response.Write("Invoke me only through cross-page posting."); Response.End(); return; } else { // Retrieve the textbox values from FindControl TextBox TextBox1; TextBox TextBox2; TextBox1 = (TextBox)PreviousPage.FindControl("TextBox1"); TextBox2 = (TextBox)PreviousPage.FindControl("TextBox2"); Response.Write(TextBox1.Text+"<br>"+TextBox2.Text+"<br>"); } } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Page2</title> </head> <body> <form id="form1" runat="server"> <div align="center"> <asp:Label ID="Label1" Runat="server" EnableViewState="False"></asp:Label> <br /> <br /> <asp:HyperLink ID="HyperLink1" Runat="server" NavigateUrl="crosspage1.aspx">Back</asp:HyperLink> </div> </form> </body> </html>
-
I am building a six page survey and I was wondering if u could give me a few tips or if u know of some sites that have examples. One procedure should create the tbl_User_Signup row for the user AND a row in each of the five one to one tables. It should all be wrapped in a transaction with roll-back to ensure it either completes successfully or is rolled back for another try. The methodology for this would: If the user looses the connection in the middle they can return and the system will take them to the point where they left off. The data entered before the connection break is safe in the database so they don't have to start over. For one simple form it is ok to hold the data in memory or the current web page. What happens if the user decides to cancel in the middle of the sign up process? You delete the tbl_User_Signup record for the client and the delete cascade deletes the related records in the other five tables. So u someone help me with some model or some t-sql. 1) SignUp.aspx 2) PhysicalCharacteristics.aspx 3) PersonalityTraits.aspx 4) PersonalDetails.aspx 5) PersonalInterest.aspx 6) Questions.aspx Now I created the db with the appropriate links. CREATE TABLE [dbo].[tbl_User_SignUp] ( [userID] [int] IDENTITY (1, 1) NOT NULL , [userName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [PasswordHash] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [salt] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [HeadLine] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Title] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [FirstName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [LastName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [nvarchar] (75) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [secretWordType] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [secretWord] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Age] [int] NOT NULL , [DOB] [datetime] NOT NULL , [Zodiac] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [GenderID] [int] NOT NULL , [City] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [stateProvinceID] [int] NOT NULL , [CountryID] [int] NOT NULL , [DateCreated] [datetime] NOT NULL , [LastLogin] [datetime] NOT NULL , [LogCount] [int] NOT NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbl_User_PersonalDetails] ( [userID] [int] NOT NULL , [sexualOrientationID] [int] NOT NULL , [DrinkingID] [int] NOT NULL , [ReligionID] [int] NOT NULL , [smokingID] [int] NOT NULL , [OccupationID] [int] NOT NULL , [DrugID] [int] NOT NULL , [EducationID] [int] NOT NULL , [MaritalStatusID] [int] NOT NULL , [incomeID] [int] NOT NULL , [ChildrenID] [int] NOT NULL , [RelocateID] [int] NOT NULL , [WantChildrenID] [int] NOT NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbl_User_PersonalInterest] ( [userID] [int] NOT NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbl_User_PersonalityTraits] ( [userID] [int] NOT NULL , [AdaptableID] [int] NOT NULL , [AdventurousID] [int] NOT NULL , [AffectionateID] [int] NOT NULL , [AggressiveID] [int] NOT NULL , [AloofID] [int] NOT NULL , [AmbitiousID] [int] NOT NULL , [ArrogantID] [int] NOT NULL , [ArtisticID] [int] NOT NULL , [bossyID] [int] NOT NULL , [CalmID] [int] NOT NULL , [CaringID] [int] NOT NULL , [CharmingID] [int] NOT NULL , [CleverID] [int] NOT NULL , [CompassionateID] [int] NOT NULL , [CompetitiveID] [int] NOT NULL , [ConfidentID] [int] NOT NULL , [CourageousID] [int] NOT NULL , [CreativeID] [int] NOT NULL , [DeepID] [int] NOT NULL , [DisciplinedID] [int] NOT NULL , [DIYID] [int] NOT NULL , [DominantID] [int] NOT NULL , [EfficientID] [int] NOT NULL , [EnergeticID] [int] NOT NULL , [ExtrovertedID] [int] NOT NULL , [FaithfulID] [int] NOT NULL , [FlexibleID] [int] NOT NULL , [ForgivingID] [int] NOT NULL , [FrugalID] [int] NOT NULL , [GenerousID] [int] NOT NULL , [HonestID] [int] NOT NULL , [HumorID] [int] NOT NULL , [impulsiveID] [int] NOT NULL , [independentID] [int] NOT NULL , [intellectualID] [int] NOT NULL , [intelligentID] [int] NOT NULL , [KindID] [int] NOT NULL , [LazyID] [int] NOT NULL , [LeaderID] [int] NOT NULL , [LovingID] [int] NOT NULL , [LoyalID] [int] NOT NULL , [ModestID] [int] NOT NULL , [MoralID] [int] NOT NULL , [NeatID] [int] NOT NULL , [OpenMindedID] [int] NOT NULL , [OptimisticID] [int] NOT NULL , [OrganizedID] [int] NOT NULL , [OutspokenID] [int] NOT NULL , [OverAchieverID] [int] NOT NULL , [PassionateID] [int] NOT NULL , [PatientID] [int] NOT NULL , [PerfectionistID] [int] NOT NULL , [PersistentID] [int] NOT NULL , [PunctualID] [int] NOT NULL , [ResilientID] [int] NOT NULL , [selfAwareID] [int] NOT NULL , [sensitiveID] [int] NOT NULL , [sincereID] [int] NOT NULL , [spontaneousID] [int] NOT NULL , [stubbornID] [int] NOT NULL , [submissiveID] [int] NOT NULL , [successfulID] [int] NOT NULL , [superstitiousID] [int] NOT NULL , [supportiveID] [int] NOT NULL , [uncomplicatedID] [int] NOT NULL , [underAchieverID] [int] NOT NULL , [understandingID] [int] NOT NULL , [VivaciousID] [int] NOT NULL , [WarmHeartedID] [int] NOT NULL , [WiseID] [int] NOT NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbl_User_PhysicalCharacteristics] ( [userID] [int] NOT NULL , [NationalityID] [int] NOT NULL , [EthnicBackgroundID] [int] NOT NULL , [AppearanceID] [int] NOT NULL , [bodyTypeID] [int] NOT NULL , [ComplexionID] [int] NOT NULL , [HairStyleID] [int] NOT NULL , [HairColorID] [int] NOT NULL , [HeightID] [int] NOT NULL , [WeightID] [int] NOT NULL , [EyeWearID] [int] NOT NULL , [EyeColorID] [int] NOT NULL , [FacialShapeID] [int] NOT NULL , [FacialHairID] [int] NOT NULL , [FashionSenseID] [int] NOT NULL , [TattooID] [int] NOT NULL , [JewelryID] [int] NOT NULL , [PiercingID] [int] NOT NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbl_User_Questions] ( [userID] [int] NOT NULL , [iPreferToBeWithID] [int] NOT NULL , [ifMyLifeWereABookID] [int] NOT NULL , [intentionID] [int] NOT NULL , [WhenIThinkAboutMoneyID] [int] NOT NULL , [ifMoneyWereNoObjectIdLiveID] [int] NOT NULL , [ToProveIAmRomanticID] [int] NOT NULL , [PublicDisplaysOfAffectionID] [int] NOT NULL , [AsACommunicatorIWouldDescribeMyselfAsID] [int] NOT NULL ) ON [PRIMARY] GO
-
Can u give me a more descriptive example please.
-
I am repopulating the checkboxlist on postback. Can someone help me with the syntax? private void FillcblMusic(DataView data) { ArrayList selItems = (ArrayList)Session["webform6_cblMusic"]; //iterate over the Items to see which are selected foreach (ArrayList selItems in this.selItems.LastIndexOf(selItems)) { if (item.Value == (ArrayList)Session ["webform6_cblMusic"].ToString()) { selItems.Add(this.cblMusic.Items.IndexOf(item)); } } }