Click here to Skip to main content
12,072,809 members (73,036 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB Oracle VB.NET
Dim _retval As New IMaCSRetVal
Below i am wriiting the code to save table values to database
Dim j As Integer
 
Dim name = Request.Form("nmlbl")
 
Dim col = Request.Form("nmcol")
 
Dim nameArr As String()
Dim colArr As String()
 
nameArr = split(name ,"")
colArr = split(col,"")
How can i fill the dataset with the help of following code?
      For j = 1 To ddlst_Scale_pointers.SelectedValue
          nameArr = sf.splitStr(name, ",")
          colArr = sf.splitStr(col, ",")
          If IsNothing(nameArr(j)) and IsNothing(colArr(j)) Then
              lblMsg.Text = "Please enter name & color for pointer"
          End If
      Next
      oDs.addRows(New String() {""})
      oDm.executeTransaction(af.convert2DArrayTo1DArray(oDs.getData()))
 
Protected Function doPageLoad(ByVal sender As Object, _
                                  ByVal e As System.EventArgs _
                                 ) As IMaCSRetVal
 
        If Page.IsPostBack = False Then
            BindGridview()
 
     
           For dp As Integer = 1 To 10
                ddlst_Scale_pointers.Items.Add(dp)
            Next
        End If
 

        Dim _retval As New IMaCSRetVal
        Dim ddlstManager As New DropDownList_Manager
        
        Return _retval
    End Function
 
    Private Function FillControls(ByVal [ID] As Int32) As IMaCSRetVal
        Dim _retval As New IMaCS.Framework.BusinessObjects.IMaCSRetVal
        Dim ds As New Kri_Scale_Dataset
        Dim oBOMgr As New Trn_Kri_Scale_Manager
        Dim dsHlpr As New DataSetHlpr
 
        _retval = oBOMgr.getData([ID], ds)
        If _retval.getErrorId <> 0 Then Return _retval
 
       
        Return _retval
    End Function
 
    Protected Function doBtnSaveClick(ByVal sender As Object, _
                                      ByVal e As System.EventArgs _
                                         ) As IMaCSRetVal
        Dim _retval As New IMaCSRetVal
 
        Dim arr As Array
        ' Step 1:
        Dim oMgr As New Trn_Kri_Scale_Manager
 
        ' Step 2,3:
        If intEditID = 0 Then ' The Save Function should do an insert.
            If Not oPageAccessPermissions.getInsertPermission Then
                _retval.setErrorID(7)
                Return _retval
            Else ' add row for insert
                ' Step 4.INSERT MODE
                _retval = oMgr.trnkriScale_Insert_row(0, _
                                                        txtScaleName.Text, _
                                                        ddlstScale_Type.SelectedValue, _
                                                        ddlstScale_Measure.SelectedValue, _
                                                        txtDescription.Text, _
                                                         txtCode.Text, _
                                                        intLoggedInUserID)
 
               _retavl = oMgr.trnscalepointer_insert_row(0, nameArr(j) ,colArr(j) , "" ,"" , "" ,intLoggedInUserID)
 

 
            End If
 
           
        Else
            If Not oPageAccessPermissions.getUpdatePermission Then  ' The Save Function should do an Update.
            
 
            End If
         
        End If
 
        ' Step 5,6:
        _retval = oMgr.updateData()
 
        ' FillControls(intEditID)

        If _retval.getErrorId <> 0 Then Return _retval ' there is an error, let the page handle the display.

        ' Step 7:
        If intEditID = 0 Then
            intEditID = oMgr.NewID
            CType(Session("oSessionInfo"), IMaCS.Framework.Security.UserManagement.UserSessionInfo).setCurrentBorrowerId(intEditID)
         
           
        Return _retval
 
    End Function
Below i have created runtime table i need to save this to database
    Protected Sub ddlst_Scale_pointers_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlst_Scale_pointers.SelectedIndexChanged
 
        Dim sb As New StringBuilder()
 
        sb.Append("<table id="table1" width="400" class="second" border="1px">")
        sb.Append("<tr>")
        sb.Append("<td>Pointer No</td>")
        sb.Append("<td>Pointer Label</td>")
        sb.Append("<td>Pointer Color</td>")
        sb.Append("</tr>")
        For i As Integer = 1 To ddlst_Scale_pointers.SelectedItem.Value
            sb.Append("<tr>")
            sb.Append("<td>" & i & "</td>")
            sb.Append("<td><input id='txtlbl" & i & "'  type='text' /></td>")
            sb.Append("<td><input id='txtcolour" & i & "' class='color' type='text' /></td>")
            sb.Append("</tr> ")
        Next
        sb.Append("</table>")
        sb.Append("")
        mydiv.InnerHtml = sb.ToString()
 
        For i As Integer = 1 To ddlst_Scale_pointers.SelectedItem.Value
        Next
      End Sub
End Class


I have created a table At runtime i need to save the data from table to dataset (and to oracle database)i need to save the individual feilds 1 by 1 to dataset to my table named scalepointer , if any of the textbox is empty i shuldnt allow to save canany1 help hhow can i stop a user from saving data if the textbox feild is empty????
Thanks in advance
Posted 19-Feb-13 2:57am
Edited 22-Feb-13 21:00pm
v6
Comments
Sandeep Mewara 19-Feb-13 9:34am
   
What is the problem? You shared the code but the issue is...?
Member 9410081 19-Feb-13 9:54am
   
how can i feel the dataset above i have marked in italic in stating code i m not getting how can i split the array and store it individually

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160208.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100