Protected Sub lnkSubmitDental_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkSubmitDental.Click
Dim userlogon As String = Split(Current.User.Identity.Name, "\")(1)
Dim lblErrorMsg As Label = DirectCast(Me.Master.FindControl("lblErrorMsg"), Label)
Dim aError As HtmlAnchor = DirectCast(Me.Master.FindControl("aError"), HtmlAnchor)
Dim lblError As Label = DirectCast(Me.Master.FindControl("lblError"), Label)
Dim PersId As String = HFID.Value
Dim AttendId As String = HFAttendID.Value
For Each item As GridDataItem In myGridDental.Items
Dim QuesId As Integer = myGridDental.Items(item.ItemIndex).GetDataKeyValue("intQuestionId")
Dim data As TextBox = (TryCast(item.FindControl("txtData"), TextBox))
Dim Remarks As TextBox = TryCast(item.FindControl("txtRemarks"), TextBox)
Dim Dtdate As TextBox = TryCast(item.FindControl("txtCal"), TextBox)
Dim answer As RadioButtonList = TryCast(item.FindControl("rblDental"), RadioButtonList)
sql = "Insert tblSRpEventData (intPersonnelId, intSRPAttendId, intQuestionId, intAnswer, strData, strRemarks, strDocDate, dtLogged, strlogged) VALUES ('" & PersId & "', " & AttendId & ", " _
& "" & QuesId & ", " & answer.SelectedValue & " , '" & Replace(data.Text, "'", "") & "', '" & Replace(Remarks.Text, "'", "") & "', '" & Replace(Dtdate.Text, "'", "") & "', '" & Date.Today & "', " _
& "'" & userlogon & "')"
Try
insertUpdateDelete(sql)
Catch ex As Exception
lblError.Text = ex.Message.ToString & " - ERROR Save Dental <br> " & lblErrorMsg.Text
SetFocus(aError)
End Try
Next
End Sub
|
Emp Id |
Emp Name |
Emp Type |
Available Location |
Format |
|
1001 |
Alexis |
Permanent |
New York |
$##,###,###.00 |
|
1002 |
Michel |
Permanent |
New Jersey |
$##,##.00 |
|
1003 |
Erin Smith |
Permanent |
Philadelphia |
$##,## |
|
1004 |
Brown Liza |
Temporary |
Los Angels |
Mmm/yyyy |
foreach (UploadedFile f in RadUpload1.UploadedFiles)
{
string strfolder;
dataquery dq = new dataquery();
string strsql;
strfolder = Server.MapPath("../noon");
f.SaveAs(strfolder + "\\" + f.GetName(), true);
strsql = "insert into images(imid,imagname) values('1','" + f.GetName() + "')";
dq.ExecuteQuery(strsql);
}
Now i want to update my record and images. but i do't know how to show images in the Radupload control or then i what to write code for update.
Please can you see my above code and help me to write update code and select record images in the Radupload. I am not using Radgrid.
Thank you so much for help.

<CommandItemTemplate> <telerik:RadToolBar runat="server" ID="RadToolBar1" OnButtonClick="RadToolBar1_ButtonClick Skin="WebBlue"> <Items> <telerik:RadToolBarButton Text="Apply filter" CommandName="FilterRadGrid" ImageUrl="~/Images/Refresh.gif"/> <telerik:RadToolBarButton Text="Add new" CommandName="xInsert" ImageUrl="~/Images/AddRecord.gif" /> </Items> </telerik:RadToolBar> </CommandItemTemplate>Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) If e.CommandName = "FilterRadGrid" Then RadFilter1.FireApplyCommand() Else If e.CommandName = "xInsert" Then Dim newWindow As New Telerik.Web.UI.RadWindow() newWindow.ID = "InsertWindow" newWindow.NavigateUrl = "~/XDW/EditPalletQty.aspx" newWindow.VisibleOnPageLoad = True RadWindowManager1.Windows.Add(newWindow) End If End If End Sub