|
|
I want to remove cache form client system programmatically even if the browser cache setting is set to “Automatically”. I have tried following options but it doesn’t work.
1) <%@ OutputCache Location="None" VaryByParam="None" %>
2) Response.Cache.SetExpires(DateTime.Today);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Please help me to sort out this problem.
Thanks is advance.
Amit
|
|
|
|
|
You can't remove anything from the client cache, you can only prevent new pages from being stored in the cache.
Either the OutputCache or SetCacheability should do that. The SetExpires should work as long as the clock of the client computer is correct, but there might be problems for other time zones.
Clear your browser cache and test if any of the methods will keep the page from being cached.
---
b { font-weight: normal; }
|
|
|
|
|
I want to call web service and i want to show with database structure in Clint Window Application by Using jboss-server.My friend make javaside web service and i make client side window application by using C#.Pls help me how can we show XMl Data Grid in C#.
Yan
|
|
|
|
|
Sure you can use Xml as datasource..
Dataset ds=new Dataset();
ds.ReadXml("xmlpath");
Datagrid1.Datasource=ds;
|
|
|
|
|
Hey everyone,
I have an sql database with a table field which is a nvarchar. But the field actually contains a date and time of an event, for each record.
Im trying to count up all the events that occurred today. Here's my code:
for (int i = 0; i < table.Rows.Count; i++)<br />
{<br />
if (table.Rows[i][0] != null)<br />
{<br />
thedate = (DateTime)table.Rows[i][0];<br />
<br />
if ((DateTime)table.Rows[i][0] == DateTime.Now)<br />
count += 1;<br />
}<br />
}<br />
2 problems. Firstly, the line thedate = ...., fails everytime. It will not cast and reports an exception about failing to assign infinity. How else can I convert the string field to a date object?
Also, the field contains a date and time. I need to compare todays date with that field, excluding the actual time. Is that possible?
Any help gratefully appreciated
Andy
|
|
|
|
|
1. You need to use DateTime.Parse(..) or DateTime.ParseExact(..)
2. In order to compare with todays date, you need to use
dt.ToShortDateString() or datetime.Today() because DateTime.Now will give you date along with time.
Note: Format of both needs to be the same
|
|
|
|
|
Thanks very much Sathish and alexey.
Did the job perfect.
Kind regards
Andy
|
|
|
|
|
Try using function:
DateTime.TryParse
To count difference between dates in days use code:
<br />
DateTime date1 = new DateTime(2000, 10, 10);<br />
DateTime date2 = DateTime.Now;<br />
TimeSpan span = new TimeSpan(date1.Ticks - date2.Ticks);<br />
int daysCount = span.Days;<br />
Best regards, Alexey.
|
|
|
|
|
Hi,
How do I map two different columnstyles to the same column in data table.
I have a table 'XYZ'.It has columns column1,column2,column3.My datagrid's datasource property
is set to default view of 'XYZ'.I hav defined the following objects:-
DataGridTableStyle-- ts1
DataGridColumnStyle-- cs1
DataGridColumnStyle-- cs2
DataGridColumnStyle-- cs3
Using MappingName property of above objects I have mapped ts1 to 'XYZ',cs1 to column1,cs2 to column2,cs3 to column3.
This works but Exception is thrown when I have to bind cs3 to column2 (or) any other column that has been already mapped
to a columnstyle object
Thanks,
Sreeroop
Developer.
|
|
|
|
|
I am a bit puzzled on WHY you would want to bind cs3 to column2, when it is already bound to column 3, however....
The only way I know to do this, is to have multiple TableStyles, and depending on conditions in your program (?), delete the first TableStyle and apply the second.
HTH
WhiteWizard (aka Gandalf)
|
|
|
|
|
Firstly,I would like to map cs3 to column2 instead of column3(even if column2 has been bound to cs2 )and yes, I had mentioned cs3 is bound to column3.
I did try using a second DataGridTableStyle object ts2, then ts2.GridColumnStyles.Add(cs3);
this allows me to map to column2 as it belongs to a different tablestyle ts2,
but Excepton was thrown when i had to bind ts2 to default view of 'XYZ'using MappingName property of ts2 . Finally,ColumnStyle cs3 should be displayed on the grid .
-- modified at 3:18 Friday 5th May, 2006
|
|
|
|
|
I have application in Byte[] array, how to run application from Byte[]?
|
|
|
|
|
Try static method:
Assembly.Load(byte[] data)
Best regards, Alexey.
|
|
|
|
|
Imagine a matrix,
S M L XL<br />
color1 10 20 30 0<br />
color2 4 5 45 50<br />
color3 1 0 4 5
You a sample matrix what i work on. columns are quantity of sizes (some of them may equals to 0 ) . Rows are colors. rows count and columns count are variable. How to save them to data base.
rows are in a table, size are saved on other table. But i couldnt solve how to save values on table. what do you offer to me ?
|
|
|
|
|
Store the sizes in one table, the model in one table, and the quantities in one table.
Size (SizeId int, SizeName varchar)
1, 'S'
2, 'M'
3, 'L'
4, 'XL'
Model (ModelId int, ModelName varchar)
1, 'color1'
2, 'color2'
3, 'color3'
ModelQuantity (ModelId int, SizeId int, Quantity int)
1, 1, 10
1, 2, 20
1, 3, 30
1, 4, 0
2, 1, 4
2, 2, 5
2, 3, 45
2, 4, 50
3, 1, 1
3, 2, 0
3, 3, 4
3, 4, 5
Alternatively, you can choose to not store any record for the quantities that are zero.
---
b { font-weight: normal; }
|
|
|
|
|
i already did so , but i think it is not effective way.
When reports i show these values as a table (using listview object).
But it is hard to populate values in to a listview.
First i read just columns for creating column header
Then i try to read values at ModelQuantity for rows. Care that all color1 values must be at the same row. So after for datareader.read process , i create a listviewitem object.
|
|
|
|
|
It's the best way if you consider possible changes in the future. You can for an example add the size "XXL" without having to change the data model.
If you give up that flexibility, you could store all sizes for a model in a single record, with each quantity in a field. This would make it simpler to get the data, but if you need to add a size it requires changes in the database and in the code.
---
b { font-weight: normal; }
|
|
|
|
|
that is why i ask for (XXL or XS or any other numeric sizes. )
i search for any easier other way but i think there is no possibility
,thank you for reply
|
|
|
|
|
Hi,
I'm making a windows form that dynamicly puts checkboxes in different FlowLayoutPanels. My problem is that when i dont turn on the AutoSize of a checkbox the text of CheckBox is wrapped. But when i turn on the AutoSize the loading of the form takes to long (about 5 seconds). Does someone knows if there is another way to auto size the text of a checkbox?
this is my code that puts the checkboxes on my form.
i have a array that contains the a string array that looks like this:
options[0] = Checbox nr
options[1] = Checkbox text
options[2] = the group index ther are 4 different groups
for(int i=0;i
|
|
|
|
|
I am working on container control that is kind of a menu where you can add buttons (which are just rectantgles with some properties), and I need to have a Vscroll bar.
the problem is that i have to rePaint my control everytime the scroll moves and I don;t know how to set the Maximun value of the scroll bar to make it move in the range i want
Javier Ruiz
|
|
|
|
|
What's wrong with the following line?
dtp_dob.Value = new DateTime(Convert.ToInt32(rrndata.Dob_Year), dtp_dob.Value.Month, dtp_dob.Value.Day);
If I show the datetimepicker value into a MessageBox it gives the correct date, but in the datetimepicker control today's date is shown
(I've also tried the Refresh method after setting the value)
This line works fine:
txtbox_dob.Text = rrndata.Dob_Day + "/" + dtp_dob.Value.Month + "/" + rrndata.Dob_Year;
tnx...
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
That constructor of DateTime expects 3 integers - year, month & day.
You are only converting the first to an integer!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Look closely . I take the month and day from the datetimepicker itself. I only change the year.
Secondly, the value of the datetimepicker is set correct, but shown wrongly.
Besides, if I would send a string to the constructor like that I would get an exception.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
you're welcome
Maybe try giving a bit more info, especially what the value of rrndata.Dob_Year contains.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|