|
I don't see why you need to make them properties if you might upgrade them in the future. If you need to make them readonly, for instance, it's a simple matter to convert them at that point.
|
|
|
|
|
The reason I do it is to make a clear distinction between data classes and 'active' classes. Validation is something which is generally part of logic and shouldn't be done by a pure data class. If I have a class that exposes fields, it's the only thing (apart from a constructor or some non-state-changing lookup functions that are trivial combinations of the fields) that it will expose.
Maintainability for a field is no worse than an auto-property, as they're source code equivalent in usage.
|
|
|
|
|
If I create a stock ActivityDesigner project, don't change anything, I can open the xaml file and see the designer.
If I create a stock ActiveLibrary project and double click on the Activity1.xaml file, I get: Index was out of range. ???
Same problem if I create a WCF workflow service and try double clicking on the xamlx file. Am I missing some component or something?
Never worked with WF before, just messing around with it.
|
|
|
|
|
Wouldn't this be better asked in the WCF and WF[^] forum?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
How would I go about getting a list of namespaces and/or assemblies referenced in a solution?
Everything makes sense in someone's mind
|
|
|
|
|
You'd normally try to do this through a Visual Studio extension. Get a reference to the DTE and that gives you access to all sorts of handy functionality. Alternatively, you could try the Object Browser if you just want an easy way to view this info.
|
|
|
|
|
This might work:
typeof(SomeClassName).Assembly.GetReferencedAssemblies
|
|
|
|
|
Guys,
Am trying to access the data from SQL SERVER 2008 via C#. I am getting an Exception. I am sure that I have problem with the query. please check this and reply...
The Code is:
private SqlDataReader GetInContainers(DateTime tFromDate,DateTime tToDate)
{
SqlConnection mycon = new SqlConnection(@"server=XYZ ; database = ABC; Trusted_Connection=yes");
mycon.Open();
string sql="Select CntNo, iso_code, InDateTime from gatein_containers where (InDateTime between #" + tFromDate.ToString("MM/dd/yyyy HH:mm:ss") + "# and #" + tToDate.ToString("MM/dd/yyyy HH:mm:ss") + "#) " +
" and (SHIPPING_LINE_CODE='1' or SHIPPING_LINE_CODE='MSL') order by InDateTime";
MessageBox.Show("Going to Execute");
SqlCommand myCommand = new SqlCommand(sql, mycon);
myReader = myCommand.ExecuteReader();
mycon.Close();
mycon.Dispose();
MessageBox.Show("Executed");
return myReader;
}
I am able to get the result when I use simple querty like:
sql="select * from daily;
|
|
|
|
|
A few things to note - you should use parameters for your queries, rather than using the text directly - you leave yourself wide open to SQL injection attacks here. When you say you get an exception, you should really tell us what the exception is, we can't read your mind. It's generally not a good idea to format your dates to anything other than the ISO standard, internally it will be stored as ISO - so you'll get a problem when you attempt to do this. AFAIK, SQL Server doesn't use # to delimit dates in queries, that's an Access format.
|
|
|
|
|
The # is the date delimiter in MS Access and SQL Server does not recognize that. Use the single quote to delimit dates. The default date format is YYYY/MM/DD. You can specify date in this format directly or use the convert function if you wish to specify date in other formats.
|
|
|
|
|
hi everyone, i've a form with a datagridview containing Name, and email address field. I've added another button column to this grid and on the click event of this button I'd like to concantenate the mailto: process and the email address field. Something like this:
if (this.dgvPresenters.Columns[e.ColumnIndex] is DataGridViewButtonColumn)
{
Process.Start("mailto + '"(this.dgvPresenters[e.ColumnIndex,e.RowIndex].Value.ToString())"'+"); }
the email field in the DB is saved as name@company.com - hope this makes sense.
Thank you
|
|
|
|
|
Hi,
To start writing mail, the correct instruction is:
Process.Start("mailto:name@company.com");
then you must change you code as:
Process.Start("mailto:" + this.dgvPresenters[e.ColumnIndex,e.RowIndex].Value.ToString());
|
|
|
|
|
thanks this helped me out
|
|
|
|
|
|
thank you for the link, I've bookmarked it for future reference
|
|
|
|
|
IS it possible to filter an excel sheet from # form. The excel sheet will be opend from Excel application or from Excel viewer. For example customer want to know the lowest price of the itemsize starting with '23565'. The excel sheet contain many items with that item size of diffrent manufacturer starting with 23565 . When the user type in textbox of the form , the excel sheet should be filtered by the value giving on the textbox.
Pls have any idea that would be very appreciate.
Pol
|
|
|
|
|
Excel already has that capability. What is it you are looking for?
Failure is not an option; it's the default selection.
|
|
|
|
|
You can use Excel Automation to do that. This[^] post will help you get started.
|
|
|
|
|
Hi there,
I have some files in my website for being downloaded by signed in users.
But due to the bandwidth limitation I have to restrict users to download only a specefic size per day for example 100MB per day.
Now I'm looking for a way to measure the user's download size.
Any help please?
|
|
|
|
|
You should really have asked this in the ASP.NET forum. Anyway, assuming that you only allow logged in users to download files, on every download request you would get the size of the specified file and see if adding it to the days total would take the user over the limit.
I know this seems obvious, but bear with me: the wrinkle you have is in defining what counts as a day - is it based on the last 24 hours activity, or is it based on an arbitrary point such as midnight on the database server. The reason you need to know this is because this will affect your calculation as to the previous day. Now, I would suggest storing the current server time in the database against each download for the user as it will make your calculations easier.
Further wrinkles for you to think about. What happens if the user aborts a download and then restarts it? Does this count towards your size limit? How are you going to handle the switch over when the clocks go forwards and backwards by an hour?
|
|
|
|
|
Thanks Pete,
for the sake of simplicity lets neglect time restriction. so here we only have the size as a criteria for dowload restriction.
for the complete dowloads I don't have any problem but somehow download process become aborted I should have the amount size of downloaded bits because this count towards my limit size.
|
|
|
|
|
With a simple database table and a simple query, you should be able to easily limit the user then. All you need do is track the amount of data downloaded against the user by time.
|
|
|
|
|
I know that. My problem here is that how can I figure out how many bits are downloaded.
I need a code snippet.
|
|
|
|
|
That really depends on how you are letting them download. If all you are doing is putting onto a response stream and letting them download that (and not worry if they abort out mid transfer), then you simply need to count the bytes you are pushing into the response stream. To be honest, this is probably your best bet as other methods become a lot more complicated.
|
|
|
|
|