Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
81 views

I am trying to get an image to upload into sql from inside Listview. I can select the image, and it make it to the server, but when i click update i get the below error. I am able to get it working from a normal aspx page.

 

Operand type clash: tinyint is incompatible with imageDescription: 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. 

Cannot insert the value NULL into column 'Logo', table 'FUNERALMANAGEMENTONLINE.dbo.Funeralhomes'; column does not allow nulls. UPDATE fails.
The statement has been terminated.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.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'Logo', table 'FUNERALMANAGEMENTONLINE.dbo.Funeralhomes'; column does not allow nulls. UPDATE fails.
The statement has been terminated.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[SqlException (0x80131904): Cannot insert the value NULL into column 'Logo', table 'FUNERALMANAGEMENTONLINE.dbo.Funeralhomes'; column does not allow nulls. UPDATE fails. The statement has been terminated.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2434922 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736592 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +225 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2026 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +337 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +280 System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +392 System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +670 System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +106 Telerik.Web.UI.RadListView.PerformUpdate(RadListViewDataItem editedItem, Boolean suppressRebind) +289 Telerik.Web.UI.RadListViewCommandEventArgs.ExecuteCommand(Object source) +350 Telerik.Web.UI.RadListView.OnBubbleEvent(Object source, EventArgs args) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 Telerik.Web.UI.RadListViewItem.OnBubbleEvent(Object source, EventArgs args) +66 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +260 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

 

Here is the code part which is giving me the issue:

Protected Sub ruCustomerImage_FileUploaded(sender As Object, e As FileUploadedEventArgs)
        'MsgBox("ruCustomerImage_FileUploaded", MsgBoxStyle.Information, "Murasalat")
        Dim updateImage As String = ", [Logo] = @Logo"
        Dim parameter As New Parameter("Logo", System.Data.DbType.Binary)
        SqlDataSource1.UpdateParameters.Add(parameter)
        SqlDataSource1.UpdateCommand = [String].Format("UPDATE FuneralHomes SET Logo = @Logo WHERE FuneralHomeId = '1000000'", updateImage)

    End Sub

 

Evelio
Top achievements
Rank 1
 answered on 16 Aug 2017
0 answers
83 views
We are using v4.0.30319 and viewing on the chrome browser v60.0.3112.90. The inline style being generated with the RadDatePicker is display:inline-block and width:160px;, although the width is 160px, the box and calendar icon take up more space, so some items are overlapping on top of the  date picker. There is a workaround to specify the width within the control, but this seems like a bug. Can anyone shed some insight?
Zachary
Top achievements
Rank 1
 asked on 16 Aug 2017
4 answers
5.3K+ views
Hi,

Is there any way to set the SelectedIndex of a RadComboBox via javascript?

I've managed to set the text to blank via this code:

var combo = $$('.wherecombotown')[0];
combo.getElementsBySelector('input')[0].value = '';

However this still keeps the selected index the same; I can't seem to find any way of setting the index back to -1;

Many thanks,

Ben
Robert
Top achievements
Rank 1
 answered on 16 Aug 2017
0 answers
74 views
01.<telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="BlackMetroTouch" DataEndField="EndTime"
02.    DataKeyField="id" DataSourceID="SqlDataSource1" DataStartField="StartTime" Height="517px"
03.    RowHeight="32px" StartEditingInAdvancedForm="False" DataSubjectField="event"
04.    DataDescriptionField="Description" DataRecurrenceField="RecData" DataRecurrenceParentKeyField="RecParent"
05.    DayStartTime="07:00:00" TimeZoneID="Eastern Standard Time" TimeZoneOffset="-04:00:00"
06.    ResolvedRenderMode="Classic">
07.    <InlineInsertTemplate>
08.        <div id="InlineInsertTemplate" class="rsCustomAppointmentContainer ">
09.            <telerik:RadDropDownList RenderMode="Auto" runat="server" ID="RadDropDownList2" DataSourceID="SqlDataSource2"
10.                Width="300px" DefaultMessage="Select Job:" DropDownHeight="200px" DataValueField="JobNumber"
11.                DataTextField="JobDes" AutoPostBack="True" OnItemSelected="JobNumSelected">
12.        </telerik:RadDropDownList>
13.            <telerik:RadDropDownList ID="RadDropDownList1" RenderMode="Auto" runat="server" AutoPostBack="true"      DefaultMessage="Select a Phase..."
14.            DropDownHeight="200px" Width="150px"  DataSourceID="SqlDataSource3" DataTextField="PhaseString" DataValueField="PhaseCode" EnableAriaSupport="False">
15.            </telerik:RadDropDownList>
16.        </div>
17.    </InlineInsertTemplate>
18.    <AdvancedForm Modal="true" />
19.</telerik:RadScheduler>
In C# within the "JobNumSelected" method I can type RadScheduler1 and it will be a valid reference to the object. I cannot type RadDropDownList1 and have it be a valid reference I can only see the base object not the instance I created. If I move the RadDropDownList object outside of the RadScheduler I can reference it just fine. 

I'm trying to make a scheduler where a user can select a job and a phase and that would show them being busy for whatever time period they selected. 
Derek Goeller
Top achievements
Rank 1
 asked on 16 Aug 2017
12 answers
973 views

Hi,

I cannot get any kind of information out of spreadsheet. sheet count is zero, I could not figured out how to access cells...

I load demo xlsx files but I cannot access any information. also there's not much in help section.

 

Does this control serves just lo load and show xls files ? what I'm missing ?
Fay
Top achievements
Rank 1
 answered on 16 Aug 2017
1 answer
130 views

I am trying to get the value of a Radeditor field in a User Control when updating to store it in my database table

In the update command of my grid I have tried using both of these commands

 

Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)

Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)

 

Dim editorcomment As RadEditor
editorcomment = CType(MyUserControl.FindControl("Comment"), RadEditor)
editorcomment = editedItem.FindControl("Comment")

Neither of these commands brings back any data in editorcomment.Content

Please can you give me some code which will retrieve the Content of the RadEditor field

 

 

Suzan
Top achievements
Rank 1
 answered on 16 Aug 2017
2 answers
119 views

 

Wondering is there a way to add some arrows on the chart to make it look similar to the following info-graphics?

https://www.nwfsc.noaa.gov/news/features/dangerous_fishing/images/infographiclarge.jpg

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 16 Aug 2017
1 answer
789 views

I have a RadGrid that I populate from my SQL database.  I use the RadGrid1_ItemCreated event to set the textbox width presently and that works fine.  Now I want to set a regular expression for the same textbox.  It is a textbox that contains an email address.  Here is my C# code:

protected void gvEmailRedirectMaint_ItemCreated(object sender, GridItemEventArgs e)
        {
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
            {
                string myMsg;
                GridEditableItem edititem = (GridEditableItem)e.Item;
                Regex regex = new Regex(@"^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$");
                TextBox txtbx = (TextBox)edititem["RedirectEmailAddress"].Controls[0];
                txtbx.Width = Unit.Pixel(300);
                Match match = regex.Match(txtbx.Text);

                if(match.Success)
                    myMsg = txtbx.Text + " is Valid";
                else
                    myMsg = txtbx.Text + " is Invalid";
            }
        }

When I run this, it performs no editing.  If I click the update button, it saves the email address even though it is not in the proper format.  What am I doing wrong?

Bob
Top achievements
Rank 1
 answered on 16 Aug 2017
1 answer
63 views
Seems like this should be easy but I cannot figure this out.  I have a RadGrid and it loads properly.  I also have an Edit button and when I click it, it displays an email address.  This works too.  It allows me to update the email address and also let's me update it.  But I cannot figure out how to change the width of the email address box.  Presently, it does not fit well.  I have no idea where this is defined.  Can anyone help?  
Bob
Top achievements
Rank 1
 answered on 16 Aug 2017
44 answers
1.2K+ views
I do not want this combobox to appear.  How do I remove it?
Anders
Top achievements
Rank 1
 answered on 16 Aug 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?