Skip to main content

Posts

how replace null to 0 in sql query

If you want to replace the null value in 0 in your sql query like the output: you have to just write as  ISNULL(DC_Requisition.MainStockID,0) as MainStockId

How to disable specific grid column in kendo ui Grid on inline editing

If you want to stop editing on specific Grid column in Kendo Ui grid like this Just use theDataAnnotations [ Editable ( false )] in your custom class for the grid i am just share my code for your help using System; using System . Collections . Generic; using System . ComponentModel . DataAnnotations; using System . Linq; using System . Web; namespace FEWO . ViewModel { public class Limitation { public long Id { get; set; } public int? LFDNR { get; set; } public Guid? ob_guid { get; set; } public DateTime? von { get; set; } public DateTime? bis { get; set; } public string einschrank { get; set; } public string wtagvon { get; set; } public string wtagbis { get; set; } public int numtagvon { get; set; } public int? numtagbis { get; set; } public int? nummonvon { get; set; } public int? nummonbis { get; set; } public int? numjahrvon { get; set; } public ...

kendo ui web selected combobox value set in textbox

Here i am using razor view <div class="editor-label"> @Html.LabelFor(model => model.ob_guid,"Im Objekt") </div> <div class="editor-field"> @(Html.Kendo().ComboBoxFor(model=>model.ob_guid) .Name("categories") .HtmlAttributes(new { style = "width:300px",id="categories" }) .Placeholder("Select category...") .DataTextField("CategoryName") .DataValueField("CategoryId") .Filter(FilterType.Contains) .DataSource(source => { source.Read(read => { read . Action ( "GetCascadeCategories" , "Limitations" ); }); }) ) </div> <div class="editor-label"> @Html.LabelFor(model => model.von,"Code") </div> ...

how to import .csv file into sql server using c#

I am using the ASP.NET MVC. here is the code that might help you that how to you convert the CSV file in List and after that you will able to save the List data in to SQL. [HttpPost] public ActionResult Create(t_NextDevAttendence t_nextdevattendence, IEnumerable<HttpPostedFileBase> files) { // Read the CSV file name & file path // I am usisg here Kendo UI Uploader string path = ""; string filenamee = ""; if (files != null) { foreach (var file in files) { var fileName = Path.GetFileName(file.FileName); path = Path.GetFullPath(file.FileName); filenamee = fileName; } // Read the CSV file data StreamReader sr = new StreamReader(path); string line = sr.ReadLine(); string[] value = line.Split(','); DataTable dt = new DataTabl...

C# remove item from ListObject

private void OnDeleteItemCommand(BO.DC_RequisitionItem reqItem) { if (reqItem.id != 0) { var objReqItem = ViewData.Requisition.DC_RequisitionItemList.SingleOrDefault(m => m.id == reqItem.id); if (objReqItem != null) { //Get deleted item by item id var itemList = new ObservableCollection<BO.DC_RequisitionItem>(); foreach (var mx in ViewData.Requisition.DC_RequisitionItemList.Where(mx => mx.ReqRefNo == reqItem.id)) { itemList.Add(mx); } if (itemList.Any()) { foreach (var m in itemList) { ViewData.Requisition.DC_RequisitionItemList.Remove(m); var da = ViewData.Requisition.DC_RequisitionItemList.FirstOrDefault( mx =>m.ReqRefNo == objReqItem.id); if (da != null) ...

Directory Listing -- / in silverlight application

In your silverlight application if can see the error. It may also arise after get latest from the source safe control. No need to worry just set up as start up page of your web ASPX file.