|
Import below namespace
add a reference to the System.IO.Compression.FileSystem assembly in your project, it will resolve you issue,
basically 'Compression' namespace is introduced in framework 4.5 and above
Find More .Net development tips at : .NET Tips
The only reason people get lost in thought is because it's unfamiliar territory.
|
|
|
|
|
In crystal reports i have used xml file to display the data. the fields are displaying but data is not displayed and parameter filter is also not working.
Below is the code:
private void _Toolbar1_Button13_Click(object sender, EventArgs e)
{
count = 0;
DataSet ds = new DataSet();
DataTable dt = new DataTable();
SiimsReports.ReportForms.FormReportDisplay frmRpt = new FormReportDisplay();
SiimsReports.Reports.ServiceRpt objservice = new SIIMS.SiimsReports.Reports.ServiceRpt();
foreach (string cust in lstCustName .SelectedItems )
{
foreach (string reg in lstRegion.SelectedItems )
{
{
foreach (string sys in lstSysName.SelectedItems )
{
string strsql = "select custname,regname ,location ,sysnames ,sysmake ,servicedate ,district,"
+ " (pendingpoints+'.' +remarks) pendingpoints,batteryreplacedon,servicetype from Leo_ServiceOrder where custname='" + cust + "' "
+ " and regname='" + reg + "' and sysnames='" + sys + "' and servicedate between '" + dtpFromDt.Value.ToString("yyyy-MM-dd") + "' and "
+ "'" + dtpToDt.Value.ToString("yyyy-MM-dd") + "'";
dt = objSO.ServiceReport(strsql);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
objSO.custname = dt.Rows[i]["custname"].ToString();
objSO.regname = dt.Rows[i]["regname"].ToString();
objSO.location = dt.Rows[i]["location"].ToString();
objSO.sysnames = dt.Rows[i]["sysnames"].ToString();
objSO.sysmake = dt.Rows[i]["sysmake"].ToString();
objSO.pendingpoints = dt.Rows[i]["pendingpoints"].ToString();
objSO.serviceorderdate = dt.Rows[i]["servicedate"].ToString();
objSO.district = dt.Rows[i]["district"].ToString();
objSO.batteryreplaced = dt.Rows[i]["batteryreplacedon"].ToString();
objSO.servicetype = dt.Rows[i]["servicetype"].ToString();
objSO.InsertServiceRpt();
}
}
}
}
}
}
string strqry = "select * from Leo_TempServiceOrder";
ds = objSO.getServiceReport(strqry);
string spath = Application.StartupPath;
string newpath = "C:\\Program Files\\Default Company Name\\LeoSetup\\";
newpath = newpath + "SiimsReports\\Reports\\ServiceReports.rpt";
CrystalDecisions.CrystalReports.Engine.ReportDocument myrpt = new ReportDocument();
myrpt.Load(newpath);
myrpt.SetDatabaseLogon("sa", "prerana123", @"DISHU-PC\SQLEXPRESS", "LeoNew");
myrpt.SetDataSource(ds);
frmRpt.crViewer.ReportSource = myrpt;
frmRpt.Show();
Please help me in resolving the above issue.
Thanks
|
|
|
|
|
First off, don't do it like that.
Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
Fixing that will very likely fix your other problem as well (and make you code more readable)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
I have created thread list and started two thread
but I could not able to listbox even I had handled the cross thread issue. now once I run the app, I could not get the cross thread error, but app is hang and form also not displaying.
below is the code form1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Globalization;
using System.Data.SqlClient;
using System.Threading;
using System.Reflection;
using System.Diagnostics;
using System.Web;
using System.Xml;
using System.Net;
namespace GALAXY_LEAD_SERVER
{
public partial class Form1 : Form
{
static int i = 0;
static int corecamp = 0;
static int cmpnID = 0;
private Thread workerThread = null;
private bool stopProcess = false;
private delegate void UpdateStatusDelegate();
private UpdateStatusDelegate updateStatusDelegate = null;
CRCSMS crcsms = new CRCSMS();
static int serverStatus = 0;
public static string mystatus = "";
static string AppLogFile = "SG_LeadServer";
public static string logPath = Directory.GetCurrentDirectory() + "\\LOGS\\" + DateTime.Now.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture).Replace("/", "");
SqlCommand cmd = new SqlCommand();
GalaxyConfig GC = new GalaxyConfig();
GalaxyLib GL = new GalaxyLib();
LIBVALUE LB = new LIBVALUE();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
mystatus = "Load SG Lead Server " + version;
this.updateStatusDelegate = new UpdateStatusDelegate(this.UpdateStatus);
this.BeginInvoke(this.updateStatusDelegate);
this.Text = "SPECTRUM LEAD SERVER " + version;
if (serverStatus == 0)
{
ServerStatustextBox.Text = "Stopped";
Startbutton.Text = "Start";
}
else
{
Startbutton.Text = "Stop";
ServerStatustextBox.Text = "Running";
}
mystatus = "Current Status: " + ServerStatustextBox.Text;
this.BeginInvoke(this.updateStatusDelegate);
}
class FileInfo
{
public int HostId { get; set; }
public string Extension { get; set; }
public string FolderPath { get; set; }
}
private void Startbutton_Click(object sender, EventArgs e)
{
var threads = new List<Thread>();
string[] services = new string[2];
services[0] = 1.ToString();
services[1] = 2.ToString();
if (serverStatus == 0)
{
AppLogFile = "SG_LeadServer";
this.stopProcess = false;
serverStatus = 1;
Startbutton.Text = "Stop";
ServerStatustextBox.Text = "Running";
for (int i = 0; i <= services.Length - 1; i++)
{
var hostID = (int)i;
FileInfo ff = new FileInfo();
var thread = new Thread(HeavyOperation)
{
Name = string.Format("myService{0}", i),
};
thread.Start(new FileInfo
{
HostId = hostID,
});
threads.Add(thread);
mystatus = "Added Thread: " + thread.Name.ToString();
this.BeginInvoke(this.updateStatusDelegate);
threads[i].Join();
mystatus = "Joined Thread: " + thread.Name.ToString();
this.BeginInvoke(this.updateStatusDelegate);
}
}
else if (serverStatus == 1)
{
this.stopProcess = true;
serverStatus = 0;
LoadCampaigns();
Startbutton.Text = "Start";
ServerStatustextBox.Text = "Stopped";
AppLogFile = "SG_LeadServer";
}
mystatus = "Current Status: " + ServerStatustextBox.Text;
this.BeginInvoke(this.updateStatusDelegate);
}
private void timer1_Tick(object sender, EventArgs e)
{
TimeLabel.Text = DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss");
}
private void HeavyOperation(object threadState)
{
for (i = 0; i <= 10; i++)
{
cmpnID = 8;
Thread.Sleep(500);
if (!this.stopProcess)
{
if (serverStatus == 0)
{
mystatus = "Server stopped.contact administrator";
return;
}
LoadCampaigns();
}
else
{
}
if (i > 9) i = 0;
}
}
private void HeavyOperation1()
{
for (i = 0; i <= 10; i++)
{
cmpnID = 10;
Thread.Sleep(500);
if (!this.stopProcess)
{
if (serverStatus == 0)
{
mystatus = "Server stopped.contact administrator";
return;
}
LoadCampaigns();
}
else
{
}
if (i > 9) i = 0;
}
}
private void UpdateStatus()
{
if (listBox1.Items.Count > 500) listBox1.Items.Clear();
this.textBox1.Text = i.ToString();
if (mystatus != "")
{
if(AppLogFile!="SG_LeadServer")
mystatus=LB.campaignName+"("+LB.campaignID+"): "+ mystatus;
this.listBox1.Items.Insert(0, DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss") + " ==> "+ mystatus);
crcsms.writeLogFile(logPath, AppLogFile, mystatus);
}
mystatus = "";
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
mystatus = "App stop: " + ServerStatustextBox.Text;
this.BeginInvoke(this.updateStatusDelegate);
this.workerThread.Abort();
}
private void LoadCampaigns()
{
if (serverStatus == 1)
{
LB.getCampaignDetails(cmpnID);
AppLogFile = LB.campaignName;
DataTable dt = new DataTable();
dt = LB.getBatchDetails(LB.campaignID);
this.BeginInvoke(this.updateStatusDelegate);
int rowindex = 0;
cmd.Connection = GC.getcon_Galaxy();
this.BeginInvoke(this.updateStatusDelegate);
foreach (DataRow row in dt.Rows)
{
string strBatch = dt.Rows[rowindex][1].ToString();
mystatus = "Found Active Batch for campaign(" + LB.campaignID + ")" + LB.campaignName + ":-" + strBatch;
this.BeginInvoke(this.updateStatusDelegate);
GalaxyLib.getCampaignDetails GL = new GalaxyLib.getCampaignDetails();
GL.updateMasterInsertQueue(LB.campaignID, strBatch,LB.outBoundDBName,LB.leadMasterTableName,LB.leadQueueTableName);
this.BeginInvoke(this.updateStatusDelegate);
rowindex = rowindex + 1;
}
}
else
{
}
}
private void Stop_service1()
{
LB.getCampaignDetails(8);
GalaxyLib.getCampaignDetails GL = new GalaxyLib.getCampaignDetails();
GL.updateDeleteWhileStoppingServer(LB.outBoundDBName, LB.leadMasterTableName, LB.leadQueueTableName);
this.BeginInvoke(this.updateStatusDelegate);
LB.getCampaignDetails(10);
GL.updateDeleteWhileStoppingServer(LB.outBoundDBName, LB.leadMasterTableName, LB.leadQueueTableName);
this.BeginInvoke(this.updateStatusDelegate);
}
}
}
|
|
|
|
|
|
Thanks Homar...Just I need one more help:
below are the steps which I did:
1)created 5 backgroundworkers and it runs parallely.
2)crated one function to write the logs
3)created one public string veriable as "myLogText".
4)called the write log function in each background worker to write the logs
5)passing myLogText string in write log function
6)once run the program, app creates the log files backgroundworkerwise and write the logs but I realised that texts are mismatching..that means one log file created by backgroundworker1 but in text file text content are there from other background worksers also
please help me ...
|
|
|
|
|
Without seeing your code, I can only guess that you're trying to update a single string variable from multiple threads.
Either use a different string variable for each BackgroundWorker, or pass the log messages to the ReportProgress method[^] and update the variable from the ProgressChanged event[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello there.
Question 1
I am given this proprietary sdk using which I am displaying video. I give this sdk the window handle and it just shows the video. Code resembles the following code
private void LoadVideo(IntPtr picboxWindowHandle)
{
ProprietarySDK obj = new ProprietarySDK();
obj.WindowHandle = picboxWindowHandle;
obj.Play();
}
And this plays the video. Fine.
But the problem is: I can not get the image from PictureBox using both Image and BackgroundImage properties as shown below
Bitmap bmp1 = pictureBox.Image;
Bitmap bmp2 = pictureBox.BackgroundImage;
What am I doing wrong here??
Question 2
Is there any chance I could draw simple string on this same picturebox. I am trying to draw using
Graphics graphics = Graphics.FromHwnd(pictureBox.Handle)
object but unable to do it. It shows absolutely nothing.
Thanks for any input.
|
|
|
|
|
- The video is (sort of) displayed on top of the picturebox, so you can't get the videopicture from the picturebox. All that is used is the windowhandle of the picturebox - you could have used any type of control that exposes a windowhandle, for instance a label or a panel.
You have to check if the ProprietarySDK (obj) exposes some method or property that returns the videopicture, otherwise the only option you have is doing a screencopy (of the picturebox area). - You can draw on top of the picturebox (image) but not on top of the video, again for the same reason as above: the video is displayed on top of the picturebox and thus on top of your drawing.
Peter
|
|
|
|
|
I have a datagrid with records and i wish to generate serial numbers automatically at the last column
My datagrid is given below
<asp:GridView ID="grid" runat="server" AutoGenerateColumns="False"
HeaderStyle-BorderColor="#996633" Width="98%" AllowPaging="True"
BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
CellPadding="3" ForeColor="Black"
onpageindexchanging="grid_PageIndexChanging" PageSize="20"
AllowSorting="True" onrowediting="grid_RowEditing"
onrowupdating="grid_RowUpdating">
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:BoundField HeaderText ="Reg. No"
ControlStyle-Width ="10%" DataField="AdmNo" SortExpression="AdmNo" >
<ControlStyle Width="20%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Ass(1)"
ControlStyle-Width = "10%" DataField="Ass1" SortExpression="Ass1" >
<ControlStyle Width="15%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Ass(2)"
ControlStyle-Width = "10%" DataField="Ass2" SortExpression="Ass2" >
<ControlStyle Width="15%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Test(1)"
ControlStyle-Width = "15%" DataField="Test1" SortExpression="Test1" >
<ControlStyle Width="15%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Test(2)"
ControlStyle-Width = "5%" DataField="Test2" SortExpression="Test2" >
<ControlStyle Width="5%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Exams"
ControlStyle-Width = "35%" DataField="Exams" SortExpression="Exams" >
<ControlStyle Width="15%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Total"
ControlStyle-Width = "5%" DataField="Total" SortExpression="Total">
<ControlStyle Width="5%"></ControlStyle>
<ItemStyle Width="5%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Grade"
ControlStyle-Width = "5%" DataField="Grade" SortExpression="Grade" >
<ControlStyle Width="5%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Remark"
ControlStyle-Width = "5%" DataField="Remark" SortExpression="Remark" >
<ControlStyle Width="5%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField HeaderText ="Position"
ControlStyle-Width = "5%" DataField="ClassPosition">
<ControlStyle Width="5%"></ControlStyle>
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:CommandField ShowEditButton="True" ShowCancelButton="False"
ButtonType="Button" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BorderColor="#996633" BackColor="Black" ForeColor="White" Font-Bold="True"></HeaderStyle>
<PagerStyle BackColor="#990000" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
</asp:GridView>
|
|
|
|
|
I'd recommend adding that to the datasource of the grid, not the grid itself. Are you using SQL to load data in the grid?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I had the strangest problem today, and I did manage to solve it but I don't understand why it wont work out of the box.
So I created an Observable that is just a range:
Observable.Range(0, 15)
.SubscribeOn(Scheduler.Default)
.Select(x => Task.Run(()=>LongRunningTask(x,
CompletedOctavebandCalcualtions,
CalculatedValues),
CancellationToken.None).ConfigureAwait(true))
.Subscribe();
I have the LongRunning task as follows:
Random RandomTimeInterval = new Random();
public FreqValues LongRunningTask(double currentInteger, IProgress<double> ProgressBarIncrement, IProgress<FreqValues> CalcualtedValues)
{
FreqValues Result = new FreqValues();
Result.Frequency = currentInteger;
Result.Value = currentInteger - RandomTimeInterval.Next(0, 10000);
Thread.Sleep(RandomTimeInterval.Next(0, 3000));
Debug.WriteLine("Current integer:{1} on threadId:{0}", Thread.CurrentThread.ManagedThreadId, Result.Frequency.ToString());
ProgressBarIncrement.Report(1);
CalcualtedValues.Report(Result);
return Result;
}
Ï used the IProgress to update the UI on how many threads had completed. I have deliberately messed up the time each thread will take to be able to spot any mistakes. Updating the UI is straight forward:
Progress<double> CompletedOctavebandCalcualtions = new Progress<double>(s =>
{
pgbProgress.Value += s;
});
Progress<FreqValues> CalculatedValues = new Progress<FreqValues>(s =>
{
UnsortedCalcualtedValues.Add(s);
MyStrings.Append(s.Frequency.ToString() + " Hz with the Value: " + s.Value.ToString() + Environment.NewLine);
if (UnsortedCalcualtedValues.Count == NumberOfFrequencies)
{
txtText.Text = MyStrings.ToString();
}
});
What I don't understand at all is why I cant get the UI values to update if I put anything in the Subscribe. I will have to ObserveOnDispatcher of course, but that is easy:
Observable.Range(0, 15)
.SubscribeOn(Scheduler.Default)
.Select(x => Task.Run(()=>LongRunningTask(x,
CompletedOctavebandCalcualtions,
CalculatedValues),
CancellationToken.None).ContinueWith(e=>e.Result))
.ObserveOnDispatcher()
.Subscribe(evt=>
{
txtText.Text += evt.Result.Frequency.ToString();
}
);
The problem with that code is simply that the callback to the progress bar doesn't work, and the code inside the Subscribe will only execute once all the threads are completed. That the end result only shows after it is completed is fine for the text box, but I need to show the calculation progress. Can anyone tell me why It won't update?
|
|
|
|
|
|
I took my approch from this article: Async in 4.5: Enabling Progress and Cancellation in Async APIs | .NET Blog[^]
I did try to use the invoke as well, inside the Task call method. I would use the invoke method like this:
this.pgbProgress.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() => { this.pgbProgress.Value += 1; }));
This is basically the WPF invoke method but unfortunately, it didn't change anything. The values didn't update until all the Rx tasks were done.
|
|
|
|
|
That article may be fine, it doesn't seem to focus on UI handling; for WinForms all Controls should be created and handled on exactly one thread, otherwise all anomalies are possible, and a temporary or permanent hangup is most likely to occur.
I trust the same holds true for WPF. Maybe your attempt failed to correct all cross-thread violations, or OTOH your code could have a second problem on top of the UI threading one.
|
|
|
|
|
Luc Pattyn wrote: That article may be fine, it doesn't seem to focus on UI handling; for WinForms all Controls should be created and handled on exactly one thread, otherwise all anomalies are possible, and a temporary or permanent hangup is most likely to occur.
That is one of the selling points of using Rx, the ease of switching between the UI thread and a background thread to ensure that the UI is responsive.Take the following example (you need the rx-main and rx-xaml NuGet packages to run the code)
var RxMouseMoveEvent = Observable.FromEventPattern<MouseEventArgs>(this, "MouseMove")
.Select(arg=>arg.EventArgs.GetPosition(this));
RxMouseMoveEvent
.ObserveOn(Scheduler.Default)
.Throttle(new TimeSpan(0, 0, 0, 0, 500))
.Select(xy => CalculatePointRelateThing(xy))
.ObserveOnDispatcher()
.Subscribe(evt =>
{
txtText.Text = evt.ToString();
});
The code does all calculation off the UI thread, so the UI doesn't hang up and remains responsive all the time. The problem was mixing this with the async Task calls seem to behave in a strange way.
Luc Pattyn wrote: Maybe your attempt failed to correct all cross-thread violations, or OTOH your code could have a second problem on top of the UI threading one.
That might be the case, but right now I'm confused and don't even know where to look for my mistake. I basically want to start several async processes in the off UI thread. Each time an async prosses finishes I want a notification sent to the subscriber together with the result of the calculation. In addition to this, I wanted to know when all the started tasks were done, in order to display the results in an orderly fashion. After all the async processes could finish async
I did manage to get it to work, but I felt that that was a dirty hack that I didn't like and was hoping to avoid using.
|
|
|
|
|
I figured it out now, turns out that the Task sends the Task instance to the Subscriber as soon as it is created, and not when it is completed, so:
.Subscribe(evt =>
{
if (!evt.IsCompleted)
Debug.WriteLine("Event Not completed");
else
Debug.WriteLine("Event completed");
pgbProgress.Value += 1;
MyStrings.Append(evt.Result.Frequency.ToString() + " Hz with the Value: " + evt.Result.Value.ToString() + Environment.NewLine);
},
() => {
txtText.Text += MyStrings.ToString();
}
);
This means that the subscribe thread on the UI is prosessing as it waits for all of the results to come in before it updates the UI.
|
|
|
|
|
Finally understood how to do this the proper way:
Observable.Range(0, 5)
.SubscribeOn(Scheduler.Default)
.SelectMany(x => Task.Run<FreqValues>(() => DoTaskWork(x), ctr.Token))
.ObserveOnDispatcher()
.Subscribe(args => {
pgbProgress.Value += 1;
txtText.Text += Environment.NewLine + args.Frequency.ToString();
},
() => {
txtText.Text += Environment.NewLine + "All done";
}
);
Trick was to use the SelectMany instead of the Select. This will return the T value from the Task<t> once any of the threads is completed.
|
|
|
|
|
Here's a behavior I have not seen before:
1. open a WinForms project
2. add a UserControl, put some controls on it, like a button
3. add a second UserControl, and set it to inherit from the first UserControl rather than 'UserControl
Now try to open the design-time view of the second UserControl: sometimes it's visible, and other times you get a message like this:Message 1 The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file:
BoolValidatingTextBox --- The base class 'March_15_ValidatingTextBox2.ValidatingTextBoxBase3<system.boolean>' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. 0 0 The same project producing the error, when opened in VS 2015, shows the inheriting UserControls properly in the design-time view.
Even though the inheriting UseControls will not display at design-time, they are fully functional: you can drag-drop them onto a Form, and see the correct design-time view of the Form.
Anyone else had this head-ache ? I've examined the various .config and .csproj files looking for some clue to this, but found nothing.
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
Um...works for me, but on 2013.
Microsoft Visual Studio Community 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.6.01038
Installed Version: Professional
I did manage to cause the same error, but a quick build got rid of it (which makes sense).
And once it's gone, it's gone...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks, Griff, I'm using:
Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.6.01055
Installed Version: Professional
I am compiling the current project with .NET 4.5. The VS 2015 version I have is, of course, the Community Edition. I've tried all the flavors of cleaning and re-building and building. The setting I am using for the build are all very standard for me (the current machine is 64 bit): prefer 32 bit, Any CPU, Define Debug, Define trace both checked.
Since I was able to repo the unexpected behavior with a very simple test case, I discount the idea that the fact the current project uses a "base" UserControl with a generic parameter, and the inheritors specify the parameter type, is leading to the unexpected behavior. And, no sign of this problem in VS 2015. Like this:
namespace ANameSpace
{
[ToolboxItem(false)]
public partial class ValidatingBase<T> : UserControl
{
public ValidatingBase()
{
InitializeComponent();
namespace ANameSpace
{
[ToolboxItem(true)]
public partial class PersonValidator : ValidatingBase<Person>
{
public PersonValidator()
{
InitializeComponent();
As I said, the only issue is the lack of design-time UI view; the UserControls appear in the ToolBox, can be drag-dropped onto a Form where they appear as expected and the solution ... works
Always something new ...
cheers, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
write a console application in c# which contain a list of doctors and a list of departments. in this application a department can contain
many number of doctors but any doctor can a part of only one department. and make application flexible to add and remove doctors and departments.
|
|
|
|
|
Ok, you have my permission to proceed.
Hint: This is not a question.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
|