Object reference Error when filling textbox with data from database - asp.net

I am trying to fill a text box with an ID of O1IDText when the selected value of a drop down list is changed. I get an error "Object reference not set to an instance of an object".
Here is my code in ASP of the drop down list:
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" AutoPostBack="true" runat="server" DataSourceID="SqlDataSource2" AppendDataBoundItems="true" OnDataBinding="DropDownlist1_DataBinding1" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" DataTextField="FullName" DataValueField="FullName" SelectedValue='<%# Bind("Official1") %>'>
</asp:DropDownList>
</EditItemTemplate>
Below is the code of my Textbox wihtin ASP:
<EditItemTemplate>
<asp:TextBox ID="O1IDText" runat="server" Text='<%# Bind("O1ID") %>'></asp:TextBox>
</EditItemTemplate>
And Finally my code behind in VB:
Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ddList As DropDownList = CType(sender, DropDownList)
RemoveHandler ddList.DataBinding, AddressOf DropDownlist1_DataBinding1
Dim O1IDText As TextBox = TryCast(FindControl("O1IDText"), TextBox)
Dim cmd As SqlCommand = con.CreateCommand()
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "Select ID from Official where [First Name] + ' ' + [Last Name]+ ' ' +[Email]+ ' ' +[Phone] = '" + ddList.SelectedValue + "'"
Dim dr As SqlDataReader
Try
con.Open()
dr = cmd.ExecuteReader()
dr.Read()
O1IDText.Text = dr("ID").ToString
Catch ex As Exception
con.Close()
End Try
The exception "Object reference not set to an instance of an object" happens during O1IDText.Text = dr("ID").ToString.

Assuming that the DropDownList and the TextBox are both in the same row or item, you can get the TextBox this way:
Dim O1DText As TextBox = CType(ddList.NamingContainer.FindControl("O1DText"), TextBox)

Related

Gridview with textboxes and SQL Server database

I'm working on a web app using Visual Studio and VB.net. I have a grid view with textboxes. When I try to get the string from the textboxes of each row to update my database, it is empty though there is something in.
I want to know why
Here is the declaration of the textboxes in the gridview ;
<asp:TemplateField HeaderText="TpNote">
<ItemTemplate>
<asp:TextBox ID="TpTextBox" runat="server" width="50px" BorderWidth="0px"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="CiNote">
<ItemTemplate>
<asp:TextBox ID="CiTextBox" runat="server" width="50px" BorderWidth="0px" AutoPostBack="False" CausesValidation="False" ClientIDMode="Inherit"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="CfNote">
<ItemTemplate>
<asp:TextBox ID="CfTextBox" runat="server" width="50px" BorderWidth="0px"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
And here is the code behind:
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim rqt1, rqt2, rqt3, rqt4 As String
con.Open()
Dim i As Integer
i = 0
Try
For Each row As GridViewRow In GridView1.Rows
Dim t As TextBox
Dim ccNote As String
t = CType(row.Cells(i).FindControl("CcTextBox"), TextBox)
ccNote = t.Text
Dim t1 As TextBox
Dim tpNote As String
t1 = CType(row.Cells(i).FindControl("TpTextBox"), TextBox)
tpNote = TextBox2.Text
Dim t2 As TextBox
Dim ciNote As String
t2 = CType(row.Cells(i).FindControl("CiTextBox"), TextBox)
ciNote = t2.Text
MsgBox(t2.Text)
Dim t3 As TextBox
Dim cfNote As String
t3 = CType(row.Cells(i).FindControl("CfTextBox"), TextBox)
cfNote = t3.Text
Dim matricule As String
Try
matricule = GridView1.Rows(i).Cells(0).Text
Catch ex As Exception
End Try
i = i + 1
rqt1 = "Update INSCRITMODULE set CcNote ='" + ccNote + "' where (INSCRITMODULE.Matricule)='" + matricule + "'"
rqt2 = "Update INSCRITMODULE set TpNote ='" + tpNote + "' where (INSCRITMODULE.Matricule)='" + matricule + "'"
rqt3 = "Update INSCRITMODULE set CiNote ='" + ciNote + "' where (INSCRITMODULE.Matricule)='" + matricule + "'"
rqt4 = "Update INSCRITMODULE set CfNote ='" + cfNote + "' where (INSCRITMODULE.Matricule)='" + matricule + "'"
Dim commande1 As New SqlCommand With {
.CommandText = rqt1,
.Connection = con
}
commande1.ExecuteNonQuery()
Dim commande2 As New SqlCommand With {
.CommandText = rqt2,
.Connection = con
}
commande2.ExecuteNonQuery()
Dim commande3 As New SqlCommand With {
.CommandText = rqt3,
.Connection = con
}
commande3.ExecuteNonQuery()
Dim commande4 As New SqlCommand With {
.CommandText = rqt4,
.Connection = con
}
commande4.ExecuteNonQuery()
Next
con.Close()
Catch ex As Exception
End Try
End Sub
Thank you
I would suggest first debug the code and try to make sure if each asp textbox value is coming to t1,t2,..... to backend and then we can figure out rest of the thing.
I would suggest,
<asp:TemplateField HeaderText="TpNote">
<ItemTemplate>
<asp:TextBox ID="TpTextBox" runat="server" width="50px"
Text ='<%#Eval("CCNote")' BorderWidth="0px"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
similarly bind values all textboxes which you want to get value in code behind.
and then find textbox and get its value

Child gridview update event

I have problem regarding child gridview (gridview inside ListView), so far i solved the databind and the the Delete command , but i couldn't figure out the Edut Mode ( i click the image button) but the GV doesn't go to edit mode the codes are as follows: thanks in advance
Page mark-up:
EditItemTemplate
<asp:ImageButton ID="imgbUpdate" runat="server" CommandName="Update" Text="Update" ImageUrl="~/Images/save_icon_mono.gif" CausesValidation="true" ValidationGroup="vgrpSaveContact"/>
<asp:ImageButton ID="imgbCancel" runat="server" CommandName="Cancel" Text="Cancel" ImageUrl="~/Images/undo_icon_mono.gif" CausesValidation="false"/>
EditItemTemplate
<ItemTemplate>
<table>
<tr>
<td> <asp:ImageButton ID="imgbEdit" runat="server" CommandName="Edit" Text="Edit" ImageUrl="~/Images/edit_icon_mono.gif" />
</td>
<td> <asp:ImageButton ID="imgbDelete" runat="server" CommandName="Delete" Text="Delete" ImageUrl="~/Images/delete_icon_mono.gif" ToolTip="Delete"/>
</td>
</tr>
</table>
</ItemTemplate>
Code VB.NET
Protected Sub gvSorties_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
Dim connString As String = ConfigurationManager.ConnectionStrings("MoyensAeriensConnectionString").ConnectionString
Dim gvTemp As GridView = DirectCast(sender, GridView)
gvUniqueID = gvTemp.UniqueID
'Get the value
Dim strSortieID As String = DirectCast(gvTemp.Rows(e.RowIndex).FindControl("lblSortieID"), Label).Text
Using conn As New SqlConnection
conn.ConnectionString = connString
conn.Open()
Try
Dim strSQL As String = ""
Dim dsTemp As New SqlDataSource()
dsTemp.ConnectionString = connString
'Get the values stored in the text boxes
Dim strMissionNo As String = DirectCast(gvTemp.Rows(e.RowIndex).FindControl("txtMissionNo"), TextBox).Text
Dim strCaptain As String = DirectCast(gvTemp.Rows(e.RowIndex).FindControl("txtCaptain"), TextBox).Text
Dim strCrew As String = DirectCast(gvTemp.Rows(e.RowIndex).FindControl("txtCrew"), TextBox).Text
Dim strFuel As String = DirectCast(gvTemp.Rows(e.RowIndex).FindControl("txtFuel"), TextBox).Text
'Prepare the Update Command of the DataSource control
strSQL = "UPDATE Sortie set MissionNo = '" & strMissionNo & "'" & ",Captain = " & strCaptain & "" & ",Crew = '" & strCrew & "'" & ",Fuel = '" & strFuel & "'" & " WHERE SortieID = " & strSortieID
dsTemp.UpdateCommand = strSQL
dsTemp.Update()
'Reset Edit Index
gvEditIndex = -1
lvODV.DataBind()
conn.Close()
Catch
End Try
End Using
End Sub
Many thanks to every one

radio buttons selected values is not working

I have tried to select radio button from selected value of a drop down like this
Dim ddlupd As DropDownList = CType(grid.HeaderRow.FindControl("dropdown"), DropDownList)
For Each gv As GridViewRow In grid.Rows
Dim rdo As RadioButtonList = CType(grid.Rows(gv.RowIndex).FindControl("list"), RadioButtonList)
Dim cat As Label = CType(grid.Rows(gv.RowIndex).FindControl("lblcat"), Label)
If cat.Text = ddlupd.SelectedItem.Text Then
rdo.SelectedValue = selflg.ToString()
ElseIf ddlupd.SelectedItem.Text = "Clear Selection" Then
rdo.ClearSelection()
ElseIf ddlupd.SelectedItem.Text = "Select All" Then
rdo.SelectedValue = selflg.ToString()
End If
Next
and there is template field in gridview like this
<asp:TemplateField HeaderText="Status">
<HeaderTemplate>
<asp:DropDownList ID="dropdown" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlupdGM1" BackColor="#3399FF" ForeColor="White">
<asp:ListItem>Select Category</asp:ListItem>
<asp:ListItem>Clear Selection</asp:ListItem>
<asp:ListItem Value="1">Cane Payment</asp:ListItem>
<asp:ListItem Value="2">Income Tax</asp:ListItem>
<asp:ListItem Value="3">Fund Transfer</asp:ListItem>
<asp:ListItem Value="4">Others</asp:ListItem>
</asp:DropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:RadioButtonList ID="chkStatusGM" runat="server" AutoPostBack="false" RepeatDirection="Horizontal" OnSelectedIndexChanged="chkStatus_OnCheckedChangedGM">
<asp:ListItem Value="5">Approve</asp:ListItem>
<asp:ListItem Value="0">Not Approved</asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
Also I Am running a update command to database with selected values of radio button.Problem is that when select the radio button from drop down value of header template then no update runs due to null selection of radiobutton and when i manually select the radio button the update works fine.
Update
**
Protected Sub chkStatus_OnCheckedChangedGM(ByVal sender As Object, ByVal e As System.EventArgs)
Dim cmd As OleDbCommand = New OleDbCommand()
Dim chkStatusGM As RadioButtonList = CType(sender, RadioButtonList)
Dim row As GridViewRow = CType(chkStatusGM.NamingContainer, GridViewRow)
Dim bpvnum As String = row.Cells(4).Text
cmd.CommandText = "update sml.FND_01_11#wbg set sta_flg=:sta_flg where bpv_num=:bpv_num and bpv_dte=:bpv_dte"
cmd.CommandType = CommandType.Text
cmd.Connection = con
cmd.Parameters.Add(":sta_flg", OleDbType.BigInt).Value = chkStatusGM.SelectedValue
cmd.Parameters.Add(":bpv_num", OleDbType.BigInt).Value = bpvnum
cmd.Parameters.Add(":bpv_dte", OleDbType.Date).Value = TreeView2.SelectedValue
Try
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
Response.Write(ex.ToString())
End Try
End Sub
**
Call the SelectedIndexChanged event of the radio button list (or whatever event handler you are using):
Dim ddlupd As DropDownList = CType(grid.HeaderRow.FindControl("dropdown"), DropDownList)
For Each gv As GridViewRow In grid.Rows
Dim rdo As RadioButtonList = CType(grid.Rows(gv.RowIndex).FindControl("list"), RadioButtonList)
Dim cat As Label = CType(grid.Rows(gv.RowIndex).FindControl("lblcat"), Label)
If cat.Text = ddlupd.SelectedItem.Text Then
rdo.SelectedValue = selflg.ToString()
ElseIf ddlupd.SelectedItem.Text = "Clear Selection" Then
rdo.ClearSelection()
ElseIf ddlupd.SelectedItem.Text = "Select All" Then
rdo.SelectedValue = selflg.ToString()
End If
' call the event handler similar to manually clicking an option
chkStatus_OnCheckedChangedGM(rdo, new System.EventArgs())
Next

Checkbox update in GridView

When people search on my website using a GridView I would like to have a checkbox column that they click on which will change the value in a column called STATUS to U. I'm having a heck of a time finding code that works so I was hoping you guys could help. I'm a COMPLETE NOOB so please be descriptive if you know the answer.
Code for Checkbox button - Currently when I search it comes back saying that it cannot convert string to boolean.
<asp:TemplateField HeaderText="Successful Contact?">
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" checked='<%#Bind("status")%>' AutoPostBack="true" />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" checked='<%#Bind("status")%>'
Enabled="False" /></ItemTemplate>
</asp:TemplateField>
This is the vb code
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
For Each GridViewRow In GridView1.Rows
Dim row As GridViewRow = GridView1.Rows(e.RowIndex)
Dim value As Boolean
value = DirectCast(GridView1.Rows(e.RowIndex).Cells(0).FindControl("CheckBox1"), CheckBox).Checked
Dim connectionString As String = ConfigurationManager.ConnectionStrings("Data Source=server;Initial Catalog=i3FCC01;Integrated Security=True;").ConnectionString
Dim com_sql As New SqlClient.SqlCommand
Dim insertSql As String
insertSql = "Update CallQueueFCC Set Status='U' where Id = #id"
Using myConnection As New SqlConnection(connectionString)
myConnection.Open()
Dim myCommand As New SqlCommand(insertSql, myConnection)
myCommand.Parameters.AddWithValue("#status", value)
myCommand.ExecuteNonQuery()
myConnection.Close()
End Using
Next
GridView1.EditIndex = -1
DataBind()
End Sub
You are binding Status value for check box checked attribute which takes Boolean value.
But status has string value as you are binding string to Boolean it is throwing error.
Like Kiran mentioned earlier, status has a string value so you need to do some firefighting in the row databound event.
Markup
<asp:TemplateField HeaderText="Successful Contact?">
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server"
Enabled="False" /></ItemTemplate>
</asp:TemplateField>
Code behind
Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'Evaluate the state of the check box, true when status =U , and false otherwise
Dim itemstatus As Boolean=If(DataBinder.Eval(e.Row.DataItem, "Status"), True, False)
Dim CheckBoxItemTemp As CheckBox=CType(e.Row.FindControl("CheckBox1"), CheckBox)
CheckBoxItemTemp.Checked=itemstatus
End if
If e.Row.RowState & DataControlRowState.Edit Then
'same as above but now for edit item template
Dim editstatus As Boolean=If(DataBinder.Eval(e.Row.DataItem, "Status"), True, False)
Dim CheckBoxEditTemp As CheckBox=CType(e.Row.FindControl("CheckBox1"), CheckBox)
CheckBoxEditTemp.Checked=editstatus
End if
End Sub

Why isn't the new values pulling up when I update the GridViewRow?

So what's happening is that I click the Edit button, type the updated values and hit Update. But the code-behind gets the original values not the updated values. I can't figure out why. It's always worked before.
Markup
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
CellPadding="7" ForeColor="#333333" GridLines="None" Font-Size="Small"
ShowFooter="True" DataKeyNames="CapID">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="AllocationId">
<ItemTemplate>
<asp:Label ID="show" runat="server" Text='<%# Eval("CapID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reference Number">
<ItemTemplate>
<asp:Label ID="showRefNo" runat="server" Text='<%# Eval("RefNo") %>'/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="EditRefNo"
Text='<%# Bind("RefNo") %>'/>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox runat="server" ID="InsertRefNo"
Text='<%# Bind("RefNo") %>'/>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Resource">
<ItemTemplate>
<asp:Label ID="showResource" runat="server"
Text='<%# Eval("Resource") %>'/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="EditResource"
Text='<%# Bind("Resource") %>'/>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox runat="server" ID="InsertResource"
Text='<%# Bind("Resource") %>'/>
</FooterTemplate>
</asp:TemplateField>
<!-- and so on... -->
</Columns>
<!-- styles etc -->
<EmptyDataTemplate>
Ref Num: <asp:TextBox ID="newRefNo" runat="server"/>
Resource: <asp:TextBox ID="newResource" runat="server"/>
Hours Allocated: <asp:TextBox ID="newHours" runat="server"/>
Week Offset: <asp:TextBox ID="newOffset" runat="server"/>
<asp:Button runat="server" ID="NewDataInsert"
CommandName="NewDataInsert" Text="Insert"/>
</EmptyDataTemplate>
</asp:GridView>
Code Behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
If Not IsPostBack Then
GridView1_DataBind()
GridView2_DataBind()
End If
End Sub
Protected Sub GridView2_RowUpdating(ByVal sender As Object, ByVal e As
GridViewUpdateEventArgs) Handles GridView2.RowUpdating
Dim capID As Label = GridView2.Rows(e.RowIndex).Cells(0)
.FindControl("show")
Dim refNo As TextBox = GridView2.Rows(e.RowIndex).Cells(1)
.FindControl("EditRefNo")
Dim resource As TextBox =
GridView2.Rows(e.RowIndex).Cells(2).FindControl("EditResource")
Dim hours As TextBox =
GridView2.Rows(e.RowIndex).Cells(3).FindControl("EditHours")
Dim offSet As TextBox =
GridView2.Rows(e.RowIndex).Cells(4).FindControl("EditOffset")
Dim newResAlloc As DataTable = resourceInfo.loadResAllocations
Dim updateRows As DataRow() =
newResAlloc.Select("CapID = " & "'" & capID.Text & "'")
If (Not updateRows Is Nothing) And updateRows.Length > 0 Then
For Each updRow As DataRow In updateRows
updRow.BeginEdit()
updRow.Item("Refno") = refNo.Text
updRow.Item("Resource") = resource.Text
updRow.Item("Hours") = hours.Text
updRow.Item("Offset") = offSet.Text
updRow.EndEdit()
Next
End If
resourceInfo.updateResAllocations(newResAlloc)
GridView2.EditIndex = -1
GridView2_DataBind()
End Sub
This could be a million and one things. What have you checked? Have you narrowed it down?
Here's some starting points for you:
Put a breakpoint inside GridView2_RowUpdating to make sure it's being called.
Check the value of capID, or capID.Text - it shouldn't be 0.
Check that your database table contains a row where CapID equals the value of capID.Text
Put a breakpoint on updateRows to ensure that the database row is being loaded into your code.
Make sure that the updRow.EndEdit() is being hit, and that the values are populated into the row correctly.
Finally, check that the updateResAllocations is working properly. It's impossible to see from here how it works, so I can't give any advice on that.
The easiest way to fix this might be to ask whoever wrote it for some assistance.
The problem was that my RowCommand method was calling the DataBind
Wrong way:
Protected Sub GridView2_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView2.RowCommand
If e.CommandName = "NewDataInsert" Then
Dim refNo As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewRefNo")
Dim resource As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewResource")
Dim hours As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewHours")
Dim offset As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewOffset")
Dim newResAlloc As DataTable = resourceInfo.loadResAllocations
Dim newAllocRow As DataRow = newResAlloc.NewRow
newAllocRow.ItemArray = New Object() {Nothing, refNo.Text, resource.Text, hours.Text, offset.Text}
newResAlloc.Rows.Add(newAllocRow)
resourceInfo.updateResAllocations(newResAlloc)
ElseIf e.CommandName = "InsertNew" Then
Dim refNo As TextBox = GridView2.FooterRow.FindControl("InsertRefNo")
Dim resource As TextBox = GridView2.FooterRow.FindControl("InsertResource")
Dim hours As TextBox = GridView2.FooterRow.FindControl("InsertHours")
Dim offset As TextBox = GridView2.FooterRow.FindControl("InsertOffset")
Dim newResAlloc As DataTable = resourceInfo.loadResAllocations
Dim newAllocRow As DataRow = newResAlloc.NewRow
newAllocRow.ItemArray = New Object() {Nothing, refNo.Text, resource.Text, hours.Text, offset.Text}
newResAlloc.Rows.Add(newAllocRow)
resourceInfo.updateResAllocations(newResAlloc)
End If
GridView2_DataBind() 'Culprit
End Sub
Right way:
Protected Sub GridView2_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView2.RowCommand
If e.CommandName = "NewDataInsert" Then
Dim refNo As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewRefNo")
Dim resource As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewResource")
Dim hours As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewHours")
Dim offset As TextBox = GridView2.Controls(0).Controls(0).FindControl("NewOffset")
Dim newResAlloc As DataTable = resourceInfo.loadResAllocations
Dim newAllocRow As DataRow = newResAlloc.NewRow
newAllocRow.ItemArray = New Object() {Nothing, refNo.Text, resource.Text, hours.Text, offset.Text}
newResAlloc.Rows.Add(newAllocRow)
resourceInfo.updateResAllocations(newResAlloc)
GridView2_DataBind() 'Only called if IF is true
ElseIf e.CommandName = "InsertNew" Then
Dim refNo As TextBox = GridView2.FooterRow.FindControl("InsertRefNo")
Dim resource As TextBox = GridView2.FooterRow.FindControl("InsertResource")
Dim hours As TextBox = GridView2.FooterRow.FindControl("InsertHours")
Dim offset As TextBox = GridView2.FooterRow.FindControl("InsertOffset")
Dim newResAlloc As DataTable = resourceInfo.loadResAllocations
Dim newAllocRow As DataRow = newResAlloc.NewRow
newAllocRow.ItemArray = New Object() {Nothing, refNo.Text, resource.Text, hours.Text, offset.Text}
newResAlloc.Rows.Add(newAllocRow)
resourceInfo.updateResAllocations(newResAlloc)
GridView2_DataBind() 'Only called if IF is true
End If
End Sub

Resources