How to determine what is causing catastrophic error - vba

I am getting catastrophic error at certain sequence on listbox form selection...
how can I determine what exactly is causing catastrophic error? The error is repeatable from my file.
On bellow code I put msgbox "a" and error doesn't appear any more... If I remove that it will apear again. Also it appears only right after I run the excel file and open forms and select item on that listbox.
Also the code is around 4000 lines and 150000 characters for this specific form. With other classes it's over 10000 lines and over 300000 characters.
Private Sub ListBox3_Change()
Dim partf As Variant, ctype As String
ReDim fncleft(4)
ReDim fncright(4)
Dim i As Integer, h As Integer
For i = 0 To Me.ListBox3.ListCount - 1
If Me.ListBox3.Selected(i) = True Then
With bomfix.ExcelTables(Me.ComboBox_Tables2.Value).settings
If Me.ListBox3.List(i, 1) <> vbNullString Then
Me.CheckBox_SQLltrim.Enabled = True
Me.CheckBox_SQLrtrim.Enabled = True
Me.CheckBox_SQLtrim.Enabled = True
Me.CheckBox_SQLlower.Enabled = True
Me.CheckBox_SQLupper.Enabled = True
Me.CommandButtonSQLreplace.Enabled = True
Me.Frame9.Visible = True
Me.TextBox_ConstraintType.Visible = True
Me.CommandButton8.Visible = True
Me.Label99.Visible = True
Me.Label100.Visible = True
Me.TextBox_ConstrTableName.Visible = True
Me.TextBox_ConstrColumnName.Visible = True
If .TableExists(Me.ListBox3.List(i, 0)) = True Then
If .Table(Me.ListBox3.List(i, 0)).ColumnExists(Me.ListBox3.List(i, 1)) = True Then
Me.ComboBox_PartTable.List = .Tables
Me.ComboBox_PartTable.AddItem vbNullString, 0
With .Table(Me.ListBox3.List(i, 0))
Me.CheckBox_FullJoinTable.Enabled = True
Me.CheckBox_FullJoinTable.Value = .FullJoin
With .column(Me.ListBox3.List(i, 1))
Me.TextBox_ExportName.Value = .Value
Me.CheckBox_ColumnHidden.Value = .Hidden
Me.CheckBox_ColumnEnabled.Value = .Active
Me.TextBox_ConstraintType.Value = .ConstraintType
Me.TextBox_ConstrTableName.Value = .ConstraintTable
Me.TextBox_ConstrColumnName.Value = .ConstraintColumn
Me.CheckBox_SQLltrim.Value = .SQLltrim
Me.CheckBox_SQLrtrim.Value = .SQLrtrim
Me.CheckBox_SQLtrim.Value = .SQLtrim
Me.CheckBox_SQLlower.Value = .SQLlower
Me.CheckBox_SQLupper.Value = .SQLupper
MsgBox "b"
partf = .PartitionFilter
If Not UBound(partf) < 0 Then
Me.TextBox_PartResults.Value = partf(0)
If bomfix.ExcelTables(Me.ComboBox_Tables2.Value).settings.TableExists(partf(1)) = True Then
Me.ComboBox_PartTable.Value = partf(1)
Me.ComboBox_PartColumn.List = bomfix.ExcelTables(Me.ComboBox_Tables2.Value).settings.Table(Me.ComboBox_PartTable.Value).Columns
Me.ComboBox_PartColumn.AddItem vbNullString, 0
If bomfix.ExcelTables(Me.ComboBox_Tables2.Value).settings.Table(partf(1)).ColumnExists(partf(2)) = True Then
Me.ComboBox_PartColumn.Value = partf(2)
Me.ComboBox_PartOrderBy.Value = partf(3)
End If
End If
Else
Me.TextBox_PartResults.Value = vbNullString
Me.ComboBox_PartTable.Value = vbNullString
Me.ComboBox_PartColumn.Value = vbNullString
Me.ComboBox_PartOrderBy.Value = vbNullString
End If
Me.TextBox_FuncLeftCol.Value = Me.ListBox3.List(i, 0) & "." & Me.ListBox3.List(i, 1)
Me.ComboBox_FuncRightVal.Value = Me.ComboBox_FuncRightVal.List(0)
' add filters Array(and_or, Comparator, tableright, columnright, FunctionRight, FunctionLeft)
Me.ListBox4.Clear
For h = 1 To .FilterSet.Count
Me.ListBox4.AddItem
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 0) = .FilterSet(h)(0) ' and_or
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 1) = Join(.FilterSet(h)(5), "|") ' function left
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 2) = .FilterSet(h)(1) ' comparator
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 3) = .FilterSet(h)(2) ' table right
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 4) = .FilterSet(h)(3) ' column right
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 5) = Join(.FilterSet(h)(4), "|") ' function right
Next
End With
End With
End If
End If
ElseIf Me.ListBox3.List(i, 2) <> vbNullString Then
If .Aggregates.Exists(Me.ListBox3.List(i, 0)) = True Then
With .Aggregates(Me.ListBox3.List(i, 0))(1)
Me.CheckBox_SQLltrim.Enabled = False
Me.CheckBox_SQLrtrim.Enabled = False
Me.CheckBox_SQLtrim.Enabled = False
Me.CheckBox_SQLlower.Enabled = False
Me.CheckBox_SQLupper.Enabled = False
Me.CommandButtonSQLreplace.Enabled = False
Me.CheckBox_FullJoinTable.Enabled = False
Me.Frame9.Visible = False
Me.TextBox_ConstraintType.Visible = False
Me.CommandButton8.Visible = False
Me.Label99.Visible = False
Me.Label100.Visible = False
Me.TextBox_ConstrTableName.Visible = False
Me.TextBox_ConstrColumnName.Visible = False
Me.TextBox_ExportName.Value = .Value
Me.CheckBox_ColumnHidden.Value = .Hidden
Me.CheckBox_ColumnEnabled.Value = .Active
Me.TextBox_ConstraintType.Value = .ConstraintType
Me.TextBox_ConstrTableName.Value = .ConstraintTable
Me.TextBox_ConstrColumnName.Value = .ConstraintColumn
Me.TextBox_FuncLeftCol.Value = "aggregate"
Me.ComboBox_FuncRightVal.Value = Me.ComboBox_FuncRightVal.List(0)
' add filters Array(and_or, Comparator, tableright, columnright, FunctionRight, FunctionLeft)
Me.ListBox4.Clear
For h = 1 To .FilterSet.Count
Me.ListBox4.AddItem
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 0) = .FilterSet(h)(0)
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 1) = Join(.FilterSet(h)(5), "|")
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 2) = .FilterSet(h)(1)
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 3) = .FilterSet(h)(2)
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 4) = .FilterSet(h)(3)
Me.ListBox4.List(Me.ListBox4.ListCount - 1, 5) = Join(.FilterSet(h)(4), "|")
Next
End With
End If
End If
End With
Exit For
End If
Next
Me.ComboBox_FuncTypeRight.Value = Me.ComboBox_FuncTypeRight.List(0)
Me.ComboBox_FuncTypeLeft.Value = Me.ComboBox_FuncTypeLeft.List(0)
Call ComboBox_FuncComp_Change
End Sub

Related

Dev Express chart Not Updating Second Time in Vb.net

For the first time when I run my window application it will successfully run, but when I change the database column and binding then it gives me an error that specific data column is not there in database; also I am make null chart datasource but it gives an error. Please help.
Dim ctrArr As Integer
Dim serCnt As Integer
Dim series1 As New Series
Dim seriesFound As Boolean = False
For serCnt = 0 To ctrChart.Series.Count - 1
ctrChart.Series(0).ArgumentDataMember = ""
ctrChart.Series(0).ValueDataMembers(0) = ""
ctrChart.Series(0).Visible = False
Next
For ctrArr = 0 To gStrYAxisParamArray.Length - 1 'deptname'
For serCnt = 0 To ctrChart.Series.Count - 1
If UCase(Trim(gStrYAxisParamArray(ctrArr))) = UCase(ctrChart.Series(serCnt).Name.ToString) Then
ctrChart.Series(serCnt).ArgumentDataMember = ""
ctrChart.Series(serCnt).ValueDataMembers(0) = ""
ctrChart.Series(serCnt).Visible = True
ctrChart.Series(serCnt).ArgumentDataMember = gxAxis
ctrChart.Series(serCnt).ValueDataMembers.Item(0) = Trim(gStrYAxisParamArray(ctrArr))
seriesFound = True
Exit For
End If
Next
If seriesFound = False Then
series1 = New Series(Trim(gStrYAxisParamArray(ctrArr)).ToString, ViewType.Bar)
'ctrChart.Series.AddRange(New Series() {series1, series2})
ctrChart.Series.Add(series1)
series1.ArgumentDataMember = ""
series1.ValueDataMembers(0) = ""
series1.Visible = True
series1.ArgumentDataMember = gxAxis
series1.Label.Border.Visible = False
series1.ValueDataMembers(0) = Trim(gStrYAxisParamArray(ctrArr))
series1.LegendText = Trim(gStrYAxisParamArray(ctrArr).ToString)
End If
seriesFound = False
Next
cmbSeries.Items.Clear()
For ctrArr = 0 To ChrtStockDept.Series.Count - 1
With cmbSeries.Items
cmbSeries.Items.Add(ChrtStockDept.Series(ctrArr).Name.ToString)
End With
Next

VBA - IF statements with AND not working

Any help would be great. I cant seem to get the ELSEIF with the AND to work.
I am using a user-form. When they press the button the user form appears with check boxes. I am having trouble when both check boxes are checked. individually they work fine,
I am not sure what i am doing wrong. any help would be greatly appreciated
If Intact.Value = True Then
storDate = Sheets("escalation").Cells(Selection.Row, 2)
storProject = Sheets("escalation").Cells(Selection.Row, 3)
StorBill = Sheets("escalation").Cells(Selection.Row, 4)
storIntact = "Intact"
With objWord.ActiveDocument
.formfields("text2").Result = storDate
.formfields("Text3").Result = storProject
.formfields("Text4").Result = StorBill
.formfields("Text9").Result = storIntact
End With
ElseIf Compugen.Value = True Then
storDate = Sheets("escalation").Cells(Selection.Row, 2)
storProject = Sheets("escalation").Cells(Selection.Row, 3)
StorBill = Sheets("escalation").Cells(Selection.Row, 4)
storCompugen = "Compugen"
With objWord.ActiveDocument
.formfields("text2").Result = storDate
.formfields("Text3").Result = storProject
.formfields("Text4").Result = StorBill
.formfields("Text9").Result = storCompugen
End With
ElseIf Intact.Value And Compugen.Value = True Then
storDate = Sheets("escalation").Cells(Selection.Row, 2)
storProject = Sheets("escalation").Cells(Selection.Row, 3)
StorBill = Sheets("escalation").Cells(Selection.Row, 4)
storIntact = "Intact"
storDate1 = Sheets("escalation").Cells(Selection.Row, 2)
storProject1 = Sheets("escalation").Cells(Selection.Row, 3)
StorBill1 = Sheets("escalation").Cells(Selection.Row, 4)
storCompugen = "Compugen"
With objWord.ActiveDocument
.formfields("text2").Result = storDate
.formfields("Text3").Result = storProject
.formfields("Text4").Result = StorBill
.formfields("Text9").Result = storIntact
.formfields("text5").Result = storDate1
.formfields("Text6").Result = storProject1
.formfields("Text7").Result = StorBill1
.formfields("Text8").Result = storCompugen
End With
End If
Thanks in advance
Try changing the order. Otherwise as soon as one condition is met the If clause is exited.
If Intact.Value And Compugen.Value Then
'code
ElseIf Intact.Value Then
'code
ElseIf Compugen.Value Then
'code
End If
If Intact.Value = True is true then the first, not the third block will run.
Similarly if Intact.Value = True is not true and Compugen.Value = True is true, then the second block will run.
So you can see that the third block is not reachable.
The solution is to put the Intact.Value = True And Compugen.Value = True case first in the group.
Finally, Foo.Value = True is a tautology of the simpler Foo.Value. You can drop all the explicit = True comparisons.

Strange issue with Datagridview-Rows not displayed

I have a Datagridview connected to a dataset.The problem is that occasionally,when the data is refreshed,it is not displayed in the DGV.The code is:
Private Sub DisplayInDGV()
Dim SQLSet As String
Dim DASet As New OleDb.OleDbDataAdapter
Dim DSSet As New DataSet
SQLSet = "Select * From SetDisplayTable"
DASet = New OleDb.OleDbDataAdapter(SQLSet, Con)
DSSet.Clear()
DASet.Fill(DSSet, "DSSetHere")
With DGVSetView
.Refresh()
.AutoGenerateColumns = False
.DataSource = Nothing
.DataSource = DSSet.Tables(0)
.Update()
DGVSetView.Columns(i).DataPropertyName = DSSet.Tables(0).Columns(i).ToString
.Columns(0).DataPropertyName = DSSet.Tables(0).Columns(0).ToString
.Columns(2).DataPropertyName = DSSet.Tables(0).Columns(1).ToString
.Columns(3).DataPropertyName = DSSet.Tables(0).Columns(2).ToString
.Columns(4).DataPropertyName = DSSet.Tables(0).Columns(3).ToString
.Columns(5).DataPropertyName = DSSet.Tables(0).Columns(4).ToString
.Columns(6).DataPropertyName = DSSet.Tables(0).Columns(5).ToString
.Columns(7).DataPropertyName = DSSet.Tables(0).Columns(6).ToString
.Columns(8).DataPropertyName = DSSet.Tables(0).Columns(7).ToString
.Columns(9).DataPropertyName = DSSet.Tables(0).Columns(8).ToString
.Columns(10).DataPropertyName = DSSet.Tables(0).Columns(9).ToString
.Columns(11).DataPropertyName = DSSet.Tables(0).Columns(10).ToString 'Item Unique Code for Hot Edit
.Columns(14).DataPropertyName = DSSet.Tables(0).Columns(12).ToString
End With
'Updating Totals/::
For ItemRow As Integer = 0 To DGVSetView.Rows.Count - 1
If DGVSetView.Rows(ItemRow).Cells(14).Value = True Then
DGVSetView.Rows(ItemRow).Cells(12).Value = DGVSetView.Rows(ItemRow).Cells(10).Value
ElseIf DGVSetView.Rows(ItemRow).Cells(14).Value = False Then
DGVSetView.Rows(ItemRow).Cells(13).Value = DGVSetView.Rows(ItemRow).Cells(10).Value
End If
Next
'Updating School and general totals in DGV//:
Dim SchoolTotal, GeneralTotal As Decimal
For ColumnTotal As Integer = 0 To DGVSetView.Rows.Count - 1
SchoolTotal += DGVSetView.Rows(ColumnTotal).Cells(12).Value
GeneralTotal += DGVSetView.Rows(ColumnTotal).Cells(13).Value
Next
txtSchoolAmtFinal.Text = SchoolTotal
txtGeneralAmtFinal.Text = GeneralTotal
DGVSetView.Update()
'Get gross total of the DGV amount column//:
If DGVSetView.RowCount <> 0 Then
Dim GrossAmt As Decimal = 0
For Index As Integer = 0 To DGVSetView.RowCount - 1
' GrossAmt += Convert.ToDecimal(DataGridView1.Rows(Index).Cells(11).Value)
If Str(DGVSetView.Rows(Index).Cells(10).Value) = "Null" Or (DGVSetView.Rows(Index).Cells(10).Value) <= 0 Then
MsgBox("Item Number " & (DGVSetView.Rows(Index).Cells(10).Value) & " is either blank or 0", MsgBoxStyle.Exclamation, "Item Error")
Else
GrossAmt += Convert.ToDecimal(DGVSetView.Rows(Index).Cells(10).Value)
End If
Next
txtInsertGrossAmt.Text = GrossAmt ' - Val(DGVSetView.Text)
Call SetNetAmount()
End If
'Generate Serial//:
Dim X As Integer
Do While X < DGVSetView.Rows.Count
DGVSetView.Item(0, X).Value = X + 1
X = X + 1
Loop
'Disbaling editing in all columns except pending//:
With DGVSetView
.Columns(0).ReadOnly = True
.Columns(2).ReadOnly = True
.Columns(3).ReadOnly = True
.Columns(4).ReadOnly = True
.Columns(5).ReadOnly = True
.Columns(6).ReadOnly = True
.Columns(7).ReadOnly = True
.Columns(8).ReadOnly = True
.Columns(9).ReadOnly = True
.Columns(10).ReadOnly = True
End With
txtTotalItems.Text = DGVSetView.Rows.Count
For Each r As DataGridViewRow In DGVSetView.Rows
r.Cells(1).Value = True
Next r
End Sub
The problem is that occasionally,the DGV will not show any rows and displays a blank frame.At such instances.if I check in DGV.Rows.count
the result is 0 despite there being underlying data in the table.
Note that this happens randomly.At other times the DGV refreshed properly and also displays data correctly.
Also note that this DGV resides within a TabControl.
Further,when the DGV fails to display the data,the totals which I have calculated in the above sub procedure return zero value.As such the problem appears to lie somewhere in the rows not being inserted in the DGV.
Thank you.
Khalid.
//Edit;Code Updated:
#jmcilhinney I have updated my code as follows.However,the earlier problem of the DGV going blank occasionally persists.Also the update process has slowed down slightly.It seems I may be making a mistake in the location of placing the Suspend and ResumeBinding statements:
Private Sub SetPreview()
Dim SQLSet As String
Dim DASet As New OleDb.OleDbDataAdapter
Dim DSSet As New DataSet
SQLSet = "Select * From SetDisplayTable"
Dim DTDGV As New DataTable
Dim DGVBindingSource As New BindingSource
DASet = New OleDb.OleDbDataAdapter(SQLSet, Con)
DASet.Fill(DTDGV)
DGVBindingSource.DataSource = DTDGV
DGVBindingSource.ResumeBinding()
With DGVSetView
.AutoGenerateColumns = False
.DataSource = DGVBindingSource
.Columns(0).DataPropertyName = DTDGV.Columns(0).ToString
.Columns(2).DataPropertyName = DTDGV.Columns(1).ToString
.Columns(3).DataPropertyName = DTDGV.Columns(2).ToString
.Columns(4).DataPropertyName = DTDGV.Columns(3).ToString
.Columns(5).DataPropertyName = DTDGV.Columns(4).ToString
.Columns(6).DataPropertyName = DTDGV.Columns(5).ToString
.Columns(7).DataPropertyName = DTDGV.Columns(6).ToString
.Columns(8).DataPropertyName = DTDGV.Columns(7).ToString
.Columns(9).DataPropertyName = DTDGV.Columns(8).ToString
.Columns(10).DataPropertyName = DTDGV.Columns(9).ToString
.Columns(11).DataPropertyName = DTDGV.Columns(10).ToString 'Item Unique Code for Hot Edit
.Columns(14).DataPropertyName = DTDGV.Columns(12).ToString
End With
DGVBindingSource.SuspendBinding()
'Updating Totals/::
For ItemRow As Integer = 0 To DGVSetView.Rows.Count - 1
If DGVSetView.Rows(ItemRow).Cells(14).Value = True Then
DGVSetView.Rows(ItemRow).Cells(12).Value = DGVSetView.Rows(ItemRow).Cells(10).Value
ElseIf DGVSetView.Rows(ItemRow).Cells(14).Value = False Then
DGVSetView.Rows(ItemRow).Cells(13).Value = DGVSetView.Rows(ItemRow).Cells(10).Value
End If
Next
'Updating School and general totals in DGV//:
Dim SchoolTotal, GeneralTotal As Decimal
For ColumnTotal As Integer = 0 To DGVSetView.Rows.Count - 1
SchoolTotal += DGVSetView.Rows(ColumnTotal).Cells(12).Value
GeneralTotal += DGVSetView.Rows(ColumnTotal).Cells(13).Value
Next
txtSchoolAmtFinal.Text = SchoolTotal
txtGeneralAmtFinal.Text = GeneralTotal
DGVSetView.Update()
'Get gross total of the DGV amount column//:
If DGVSetView.RowCount <> 0 Then
Dim GrossAmt As Decimal = 0
For Index As Integer = 0 To DGVSetView.RowCount - 1
' GrossAmt += Convert.ToDecimal(DataGridView1.Rows(Index).Cells(11).Value)
If Str(DGVSetView.Rows(Index).Cells(10).Value) = "Null" Or (DGVSetView.Rows(Index).Cells(10).Value) <= 0 Then
MsgBox("Item Number " & (DGVSetView.Rows(Index).Cells(10).Value) & " is either blank or 0", MsgBoxStyle.Exclamation, "Item Error")
Else
GrossAmt += Convert.ToDecimal(DGVSetView.Rows(Index).Cells(10).Value)
End If
Next
txtInsertGrossAmt.Text = GrossAmt ' - Val(DGVSetView.Text)
Call SetNetAmount()
End If
'Disabling editing in all columns except pending//:
With DGVSetView
.Columns(0).ReadOnly = True
.Columns(2).ReadOnly = True
.Columns(3).ReadOnly = True
.Columns(4).ReadOnly = True
.Columns(5).ReadOnly = True
.Columns(6).ReadOnly = True
.Columns(7).ReadOnly = True
.Columns(8).ReadOnly = True
.Columns(9).ReadOnly = True
.Columns(10).ReadOnly = True
End With
txtTotalItems.Text = DGVSetView.Rows.Count
For Each r As DataGridViewRow In DGVSetView.Rows
r.Cells(1).Value = True
Next r
End Sub

Adding Between 0 and 3 Databases to a UserControl

I am trying to add a property called NumDBsToDisplay that gives the option of selecting between 0 and 3 databases to be displayed on my custom control. I can't get the property to show up in the designer, am I missing something here?
Here's the code:
Public Property NumDBsToDisplay(ByVal i As Integer) As Integer
Get
Dim count As Integer = 0
If cboPridb.Visible = True Then
count += 1
End If
If cboSecdb.Visible = True Then
count += 1
End If
If cboTridb.Visible = True Then
count += 1
End If
Return count
End Get
Set(ByVal value As Integer)
If value = 0 Then
cboPridb.Visible = False
cboSecdb.Visible = False
cboTridb.Visible = False
ElseIf value = 1 Then
lblPridB.Text = "Primary Database"
cboPridb.Visible = True
cboSecdb.Visible = False
cboTridb.Visible = False
ElseIf value = 2 Then
lblPridB.Text = "Primary Database"
lblSecDB.Text = "Secondary Database"
cboPridb.Visible = True
cboSecdb.Visible = True
cboTridb.Visible = False
Else
lblPridB.Text = "Primary Database"
lblSecDB.Width = 131
lblSecDB.Text = "Secondary Database"
lblTriDB.Text = "Tertiary Database"
cboPridb.Visible = True
cboSecdb.Visible = True
cboTridb.Visible = True
End If
End Set
End Property
Thank you for the help.

ScriptManager.RegisterClientScriptBlock hidden controls at runtime

I need your help. I would like to understand why when running ScriptManager.RegisterClientScriptBlock the controls of my page disappear and reappear only after confirmation of Ok?
Protected Sub ddlDeckFittingCategory_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles ddlDeckFittingCategory.SelectedIndexChanged
If txbNumberofColumns.Text = "" Or Me.txbShellDiameter.Text = "" Then
ScriptManager.RegisterClientScriptBlock(Me.Page, Page.GetType, "alert", "alert('Informe o valor do Diâmetro do Casco (m)!');", True)
ddlDeckFittingCategory.SelectedValue = -1
Else
If Request("TipoTela") = 1 Then
If ddlDeckFittingCategory.SelectedValue = "Typical" Then
objFinttings_temp.IncluirFittingsTempTQIFLTTipico(Session("cod_usuario_usu"))
'objFinttings_temp.AtualizaFittingsTempColumnWell_24_in_Diam(CType(txbNumberofColumns.Text, Double))
objFinttings_temp.AtualizaFittingsTempColumnWell_24_in_Diam(txbNumberofColumns.Text)
tbFittingsFonte.Visible = True
tbFittingsFonte.HeaderText = ""
TcPrincipal.ActiveTabIndex = 6
Dim dvConsultarCodFonteEmFittingsTempPorUsuario As DataView = objFinttings_temp.ConsultarCodFonteEmFittingsTempPorUsuario(Session("cod_usuario_usu"))
Session("cod_fonte_fon") = dvConsultarCodFonteEmFittingsTempPorUsuario.Table.Rows(0)("cod_fonte_fon")
Session("ddlDeckFittingCategory") = ddlDeckFittingCategory.SelectedValue
Else
objFinttings_temp.IncluirFittingsTQIFLTDetalhado(0)
tbFittings.Visible = True
tbFittings.HeaderText = ""
TcPrincipal.ActiveTabIndex = 6
End If
GrvFittingsFonte.DataBind()
Else
If ddlDeckFittingCategory.SelectedValue = "Typical" Then
objFinttings_temp.IncluirFittingsTempTQIFLTTipico(Session("cod_usuario_usu"))
'objFinttings_temp.AtualizaFittingsTempColumnWell_24_in_Diam(CType(txbNumberofColumns.Text, Double))
objFinttings_temp.AtualizaFittingsTempColumnWell_24_in_Diam(txbNumberofColumns.Text)
tbFittingsFonte.Visible = True
tbFittingsFonte.HeaderText = ""
TcPrincipal.ActiveTabIndex = 6
Else
objFinttings_temp.IncluirFittingsTQIFLTDetalhado(Session("cod_fonte_fon"))
tbFittings.Visible = True
tbFittings.HeaderText = ""
TcPrincipal.ActiveTabIndex = 6
End If
GrvFittingsFonte.DataBind()
If ddlSelfSupportingRoof.SelectedValue = 1 Or ddlSelfSupportingRoof.SelectedValue = "-1" Then
txbNumberofColumns.Enabled = False
rvNumColuna.Visible = False
ddlEffectiveColumnDiameter.Enabled = False
rvDiametroEfetivoColuna.Visible = False
Else
txbNumberofColumns.Enabled = True
rvNumColuna.Visible = True
ddlEffectiveColumnDiameter.Enabled = True
rvDiametroEfetivoColuna.Visible = True
End If
End If
End If
End Sub
enter code here
use Page.ClientScript.RegisterStartupScript()
it will run after the page loads.