RadGrid, SQLDataSource, and Oracle database

3 posts, 0 answers
  1. Keith
    Keith avatar
    93 posts
    Member since:
    Mar 2015

    Posted 08 Sep Link to this post

    I have an ASP.Net page with a RadGrid which is populated by the SQLDataSource.

    I am trying to set up the RadGrid so the user edit some fields in the RadGrid for a record and click on update. But I cannot get it to work.  When clicking on update, I get "ORA-01036: illegal variable name/number" error.

    I am connecting to an Oracle database.

    In looking at your demos, none of them use EditMode = "InPlace".  They either use an Edit Form or some custom things like textboxes, comboboxes, etc.

    I have tried having a simple update command in SQLDataSource like the following:


    That statement should update the LAST_UPDATE field with the Current Date/Time for all the records but it is causing the error as well.  That statement was just a test to see if the parameters in the SQLDataSource is causing the error and/or the Update statement is causing the error.

    Usually I set up a RadGrid to use NeedDataSource but alot of your demos and documentation for editing and updating records in the RadGrid indicate using SQLDataSource instead.

    Either way I am trying to find a way for the user to edit fields in the RadGrid and update the record.

    Please help!

    Here is my ASP.net page:

    <%@ Page Language="VB" AutoEventWireup="false" Debug="true" CodeFile="ScrapRateBySupplier.aspx.vb" Inherits="ScrapRateBySupplier" %>
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
    <!DOCTYPE html>
    <head runat="server">
        <style type="text/css">
            .auto-style1 {
                width: 960px;
                height: 220px;
            .auto-style4 {
                width: 355px;
                position: fixed;
                top: 0;
                left: 0;
                background-color: black;
                z-index: 99;
                opacity: 0.8;
                filter: alpha(opacity=80);
                -moz-opacity: 0.8;
                min-height: 100%;
                width: 100%;
                font-family: Arial;
                font-size: 10pt;
                border: 5px solid #67CFF5;
                width: 200px;
                height: 100px;
                display: none;
                position: fixed;
                background-color: White;
                z-index: 999;
            .auto-style5 {
                width: 186px;
            .auto-style6 {
                width: 264px;
            html .RadMenu .rmLink,
            html .RadMenu .rmHorizontal .rmText {
                float: none;
                padding: 0;
                text-align: center;
        <script type="text/javascript" src="/scripts/jquery.min.js"></script>
        <script type = "text/javascript" >
            function preventBack() { window.history.forward(); }
            setTimeout("preventBack()", 3);
            window.onunload = function () { null };
        <script type="text/javascript">
            function ShowProgress() {
                setTimeout(function () {
                    var modal = $('<div />');
                    var loading = $(".loading");
                    var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
                    var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
                    loading.css({ top: top, left: left });
                }, 200);
            $('form').live("submit", function () {
            $(document).ready(function () {
                $("#txtActivity").focus(function () {
                    $(this).css("background-color", "#ffff33");
                $("#txtActivity").blur(function () {
                    $(this).css("background-color", "#ffffff");
                $("#ddlUnit").focus(function () {
                    $(this).css("background-color", "#ffff33");
                $("#ddlUnit").blur(function () {
                    $(this).css("background-color", "#ffffff");
                $("#txtNote").focus(function () {
                    $(this).css("background-color", "#ffff33");
                $("#txtNote").blur(function () {
                    $(this).css("background-color", "#ffffff");
    <body style="background-color: #3A4459">
        <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            <img alt="RSDC of Michigan" class="auto-style1" src="/images/RSDC_Logo2.jpg" />
            <br />
            <telerik:RadMenu ID="RadMenu1" Runat="server" Width="960px" Style="z-index: 50">
                    <telerik:RadMenuItem runat="server" Font-Bold="True" Font-Size="14pt" NavigateUrl="CustomerPortal" Text="Home" Width="475px">
                    <telerik:RadMenuItem runat="server" IsSeparator="True" Text="Sep">
                    <telerik:RadMenuItem runat="server" Font-Bold="True" Font-Size="14pt" ForeColor="Red" Text="Logout" Width="475px">
            <br />
            <br />
            <asp:Label ID="Label2" runat="server" Font-Bold="True" ForeColor="White" Text="Scrap Rate By Supplier"></asp:Label>
            <table style="width:960px;">
                    <td style="text-align:right;"><asp:Label ID="lblTable" runat="server" ForeColor="White"></asp:Label></td>
            <asp:Panel ID="Panel1" runat="server" Height="600px" Wrap="False" BorderWidth="3px" BorderColor="Black" BorderStyle="Ridge" ForeColor="White" Width="955px" style="margin-right: 17px">
                <br />   
                <telerik:RadButton ID="rbtnAdd" runat="server" Text="ADD" RenderMode="Classic" Font-Size="11pt">
                   <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="3"></Icon>
                <asp:Label ID="Label1" runat="server"></asp:Label>
                <br />
                <br />
            <telerik:RadGrid ID="rgScrapRateBySupplier" runat="server" GroupPanelPosition="Top" Height="400px" Width="955px" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"  AllowAutomaticUpdates="True">
                    <Pdf AllowPrinting="False">
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                <MasterTableView EditMode="InPlace" DataSourceID="SqlDataSource1">
                    <CommandItemSettings ShowAddNewRecordButton="False" ShowRefreshButton="False" />
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                        <telerik:GridBoundColumn DataField="SUPPLIER" FilterControlAltText="Filter column column" HeaderText="Supplier" ReadOnly="True" UniqueName="Supplier">
                        <telerik:GridBoundColumn DataField="PRIME" FilterControlAltText="Filter column column" HeaderText="Prime" UniqueName="Prime">
                        <telerik:GridBoundColumn DataField="RSDC_SV" FilterControlAltText="Filter column1 column" HeaderText="RSDC SV" UniqueName="RSDCSv">
                        <telerik:GridBoundColumn DataField="MILL" FilterControlAltText="Filter column2 column" HeaderText="Mill" UniqueName="Mill">
                        <telerik:GridBoundColumn DataField="ENG" FilterControlAltText="Filter column3 column" HeaderText="Eng" UniqueName="Eng">
                        <telerik:GridBoundColumn DataField="LAST_UPDATE" FilterControlAltText="Filter column4 column" HeaderText="Last Update" ReadOnly="True" UniqueName="LastUpdate">
                <br />
                <br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="OverwriteChanges" ConnectionString="<%$ ConnectionStrings:OracleConnectionStringS01 %>" ProviderName="<%$ ConnectionStrings:OracleConnectionStringS01.ProviderName %>"
                    SelectCommand="SELECT * FROM ADMIN.RSDC_SCRAP_CREDIT_RATE">
            <br />
            <br />
         <div class="loading" align="center" style="z-index:100000">
            Loading. Please wait.<br />
            <br />
            <img src="loader.gif" alt="" />

    Here is the Code-behind in vb.net:

    Imports System.Data
    Imports Telerik.Web.UI
    Partial Class ScrapRateBySupplier
        Inherits System.Web.UI.Page
        Private myDSData As DataSet
        Private sql As String
        Private bHasError As Boolean = False, strErrorMsg As String
        Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
                Dim strUser As String = ""
                Dim strDecUser As String = ""
                Dim strAppName As String = "ACMENUSCRAPRATEBYSUPP"
                If Request.IsAuthenticated Then
                    If Not Session("UserName") Is Nothing Then
                        strUser = CType(Session("UserName"), String)
                        strDecUser = DataEncryption.base64Decode(strUser)
                        strDecUser = DataEncryption.base64Decode(strDecUser)
                        strDecUser = DataEncryption.base64Decode(strDecUser)
                        strUser = strDecUser
                    End If
                    If Not LoginValidation.IsValidAppAccess(strUser, strAppName) Then
                    End If
                End If
            Catch ex As Exception
                strErrorMsg = "Procedure: Page_Init - ScrapRateBySupplier" & vbCrLf & "Error Message: " & ex.Message & vbCrLf & "Source: " & ex.Source
                UserFunctions.UserMsgBox(Me, strErrorMsg)
            End Try
        End Sub
    End Class

  2. Viktor Tachev
    Viktor Tachev avatar
    1438 posts

    Posted 13 Sep Link to this post


    Please note that using SqlDataSource with Oracle database is not directly related to the RadGrid control. This is a general programming issue.

    Nevertheless, check out the following thread that discusses similar error and how it can be resolved.

    Also, examine the following article that discusses how you can use the SqlDataSource with Oracle database.

    In case you would like additional information on how to use automatic CRUD operations in RadGrid you would find the article below interesting.

    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
  4. Keith
    Keith avatar
    93 posts
    Member since:
    Mar 2015

    Posted 13 Sep in reply to Viktor Tachev Link to this post

    H Viktor,

        Thanks for your response!  Unfortunately, none of that was helpful.  For now I have removed the SQLDataSource and went back to using NeedDataSource since automatic CRUD operations was not working with the doing an UPDATE to the Oracle database.  Only the SELECT worked in the SQLDataSource.  Basically I went in the direction of doing Manual CRUD operations.


    Keith Jackson

Back to Top