|
Apology for the late response.
I partially go the code to work. as it now display's yesterday's data feed.
However, I have weekday dates data stored on server and when I call data from now.date Monday, I get a null list on the client-side.
Is their any example, where I can use to get yesterday's date data excluding weekend dates?
<pre lang="c#">public IEnumerable<database_BWICs> GetDate()
{
DateTime yesterday = DateTime.Today.AddDays(-1);
var data = from c in db.database_BWICs
where c.UploadDate == yesterday
select c;
return data.ToList();
}
Thank you so much for your support and generous gesture.
I really appreciate your time and help.
|
|
|
|
|
|
On to an issue whether or not we should move to MVC development I have been debating this with my developers now for months.
And some insist MVC is better though I just dont see it.
What makes a programming methodology better for me ?
Speed of development.
Developer spending less time on interface and normal features and more time getting validation and business logic to be solid
Code that is easy to understand by new developers taking on the project
Structure that is easy to follow and you dont have to jump between mappings and target pages to check how they link
Ability to create reusable controls
Visual designer , so you dont have to repeatedly code something as mundane as a table.
Scalability
When working with MVC4
Razor
Visual designer Gone ;(
No Server Controls
Hooking up an event is manually coded (instead of double clicking or hooking up an event
Single controller multiple pages
Bottom line is what is quicker , on asp.net I can drag a button on the exact spot i need it double click (3 seconds later) I have a button named and hooked up to an event without touching the keyboard. which the mvc guy is still busy typing his input tag , not to mention switching between the controller and the markup screens creating a event and a model.
When i used a aspx grid , I get a nice linq data source hook it up to a grid, columns gets auto generated , meaning all i have to do is change the column headers , click that I want to enable sorting and paging , and I am done 2 minutes later. and if I have not too complex columns the add edit and delete features are created for me in one shot which can be configured for more complex scenarios's
Now as an mvc developer doing the whole grid thing , everything has to be coded , I have to code my data queries (be it LINQ or SQL) to do the paging and sorting , 2 hours an insane amount of typing and script later I have something that kinda does the same thing but looks butt ugly. I guess an expereinced MVC dev can do it in probably 10 mintes flat
My Recommendation, MVC is ok for cases with little complexity and smaller size projects, but when you need to deliver something of great scale and complexity you are shooting yourself in the foot as you will still be coding interface logic when a asp.net dev is long done with the project.
Also just in case you wondering I know
1 MVC does not have viewstate : good practiice minimises viewstate/ you can also hide your viewstate in session using very basic code, also viewstate has never kept me awake one night , projects running late has
2. MVC generates easy to read markup : not really relevant since your customers only really look at the interface not the code
("but but but. . . search engines" - trust me google can handle it.
3. Ability to create clean user friendly urls - The url rewrite method has been available since .net 2, and is infinitely flexible to anyone who knows their regular expressions
The goal of industry here is.
1.to have it done quickly
2.have it done at low cost
3.and to have to have it done right
(you can have only 2 of the 3)
now needless to say 3 quality is non negotiable and 2 is usually what sells software to a client .
but 1 does not help you if developers pulling a salary takes 3 months to develop software that brings in 1 month of profit
So please explain why MVC is better ?
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
It isn't.
The Microsoft implementation of MVC is far (even version 4) from being satisfactory to me too.
I'm working on a large enterprise app and before each major version we check what new tools/environments we should use/incorporate.
MVC (not the architecture) failed with large noise...
I worked with COBOL with the idea of separated layers, but never imagined that 20 years later it will means no code-reuse...
I found MVC good only for very small size apps...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
Look there are things i like about it , but give it about 2-3 more releases before they have something a bit more commercially viable
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
2-3 more? after MVC5 of before?
It makes if 7-8 releases!!!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
Never read so much nonsense about MVC framework as I read here.
Do you know Stack Overflow? It was written using MVC.
Visual Designer? Well, I don't get where it fits on webdesigner/webdevelopment.
If you don't know nothing about HTTP and the flow of request/response go with webforms and suffer, suffer a hell in mantainance.
You don't like patterns and practices? Go with webforms.
MVC is a robust and well known architectural way to build webapps. It shares it concept from the Ruby On Rails.
MVC allows low cost mantainance even if the start of the project costs a (little) bit more.
Webforms are good for RAD, and IMHO just for that.
If you want to build flexible, robust, low mantainance cost webapps despite the complexity of then you will for sure choose MVC.
|
|
|
|
|
MVC is robust, and well known.
The Microsoft implementation isn't - not even close!!!
(I tell you a secret - I wrote according MVC 25 years ago in COBOL. No web then!)
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
I have a RadGrid using a standard grid hierarchy and am trying to open a RadWindow from within the OnItemCommand event when a radbutton column item is selected. When I select the button the code below does run (checked using a break point); however, the radwindow does not open and the radgrid itself appears to do a partial postback. Any Ideas why the rad window does not display? The code is as follows:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "ButtonEdit")
{
//opening window
RadWindow newWindow = new RadWindow();
newWindow.ID = "RadWindow1";
newWindow.NavigateUrl = "Window1.aspx";
newWindow.VisibleOnPageLoad = true;
RadWindowManager1.Windows.Add(newWindow);
}
}
Also note, the RadWindowManager is valid as it is used elsewhere on the page with no problems.
Thanks,
Steve Holdorf
|
|
|
|
|
Hi,
You wrote that RadGrid seem to do a partial post-back. You may check it by looking to IsPostBack property...
If this is true (and older RadGrid has it own ajax and used it to partial post back independently from your declarations) than setting VisibleOnPageLoad will not work (no pageload...). In that case you mast render some js to open the window...
May I suggest something?
Use client side js to open RadWindow...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
how can i add different types of image slideshow in asp.net?
|
|
|
|
|
|
Nice AJAX sample here[^]. You will find many others if you do a search.
|
|
|
|
|
Hi all,
i am developing an website in asp.net c#.
i want to select the data from database on the basis of name passed in the url,e.g
suppose this is URL: domain_name.com/abhishek-singh
and i want to select and display the data of "abhishek-singh" from the database.
How can i do this.
Please suggest.
|
|
|
|
|
|
|
|
Hi Friends
I have multiple datatables, and the datatables may or may not have data, depends on the user selection.
I have to get Cartesian Product of all the Datatables, and pass the Cartesian Product result as datasource for Gridview.
I am using following code which is working fine if all the DataTable has rows. If any of the table is not having row, then I am getting no records in my resultant cartesian product table. Please help in this.
var newDatatable = from TowerName in dtTower.AsEnumerable()
from CountryName in dtCountry.AsEnumerable()
from Level in dtLevel.AsEnumerable()
from CityName in dtCity.AsEnumerable()
from BandName in dtBand.AsEnumerable()
from EType in dtEmploymentType.AsEnumerable()
from Skill in dtSkill.AsEnumerable()
select new { TowerName, CountryName, Level, CityName, BandName, EType, Skill };
DataTable dtlinq = new DataTable("poclinq");
foreach (var item in newDatatable)
{
DataRow dr = dtlinq.NewRow();
dr["TowerName"] = item.TowerName.ItemArray[0];
dr["CountryName"] = item.CountryName.ItemArray[0];
dr["Level"] = item.Level.ItemArray[0];
dr["CityName"] = item.CityName.ItemArray[0];
dr["BandName"] = item.BandName.ItemArray[0];
dr["EType"] = item.EType.ItemArray[0];
dr["Skill"] = item.Skill.ItemArray[0];
dtlinq.Rows.Add(dr);
}
|
|
|
|
|
priyaahh wrote: If any of the table is not having row, then I am getting no records in my resultant cartesian product table.
The Cartesian product of any set with the empty set is the empty set. That's fairly basic set theory.
You'll need a custom extension method which will return a single empty row if the table is empty:
public static class DataTableExtensions
{
public static IEnumerable<DataRow> AsEnumerableNotEmpty(this DataTable table)
{
if (table == null) throw new ArgumentNullException("table");
if (table.Rows.Count != 0) return table.Rows.Cast<DataRow>();
return new[] { table.NewRow() };
}
}
You'll then need to change your LINQ query to call the custom method:
var newDatatable = from TowerName in dtTower.AsEnumerableNotEmpty()
from CountryName in dtCountry.AsEnumerableNotEmpty()
from Level in dtLevel.AsEnumerableNotEmpty()
from CityName in dtCity.AsEnumerableNotEmpty()
from BandName in dtBand.AsEnumerableNotEmpty()
from EType in dtEmploymentType.AsEnumerableNotEmpty()
from Skill in dtSkill.AsEnumerableNotEmpty()
select new { TowerName, CountryName, Level, CityName, BandName, EType, Skill };
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard,
Thanks lot for your response, it working for me.
Regards,
Priyaa.
|
|
|
|
|
Here's is how it can be done if you have dedicated host
http://stackoverflow.com/questions/2333149/how-to-fast-get-hardware-id-in-c
However, in shared hosting environment, generally references to System.Management is restricted.
Any suggestion? I hesistate to, for example, rely on just IP address...
dev
|
|
|
|
|
And why do you have such an idea as finding out hardware ids of a web server????????? Why do you need that? Hosting companies often use virtualization - and your application could seamlessly be moved from one "computer" to a different one, just as load balancing, failover, whatever require.
|
|
|
|
|
for dedicated host, hosting admin would have root access to your machine and thus can get to our asp.net app which churn out "Evaluation Licenses". As mean to lock the app to a particular machine, we generate a license. The app only works if running on the dedicated hardware.
Now with shared hosting or virtual machine, this won't work. Do you have something to suggest? Have you implemented any licensing/locking scheme that'd work in shared hsoting environment, virtual machines? or cloud? where hardware id not viable?
dev
|
|
|
|
|
Hi All,
I am saving the image to particular folder programmatically. When saving the images it has different formats ,I want to save the all images into a single format which doesn't loose the resolution
Can any one help me how can I solve the issue
Thanks,
Siddiqali
|
|
|
|
|
Where is the problem? You can set the desired format as a parameter in the Save method:
System.Drawing.Bitmap bitmap = ...;
string filename = ...;
bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
|
|
|
|