public class NewDataSet : DataSet { public NewDataSet() : base() { DataTable dt = new DataTable("table"); DataSetName = "NewDataSet"; dt.Columns.Add("item_desc", typeof(string)); dt.Columns.Add("Ins", typeof(int)); dt.Columns.Add("Kg", typeof(int)); dt.Columns.Add("Qty", typeof(int)); dt.Columns.Add("Total", typeof(int)); dt.Columns.Add("Date", typeof(DateTime)); Tables.AddRange(new DataTable[] { dt }); } public static NewDataSet CreateData(DataTable dta) { NewDataSet ds = new NewDataSet(); DataTable dt = ds.Tables.Add(dta); // warning error here: Cannot implicitly convert type 'void' to 'System.Data.DataTable' return ds; } #region Disable Serialization for Tables and Relations [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public new DataTableCollection Tables { get { return base.Tables; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public new DataRelationCollection Relations { get { return base.Relations; } } #endregion Disable Serialization for Tables and Relations }