|
That worked great, thanks a ton.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
hi
I want to implement data versioning in a application...
I need a Text Diff class library
where can I find it?
thanks.
Mohammad Khansari
modified on Monday, December 22, 2008 2:00 AM
|
|
|
|
|
Hello,
I have an .NET 1.1 C# application that gets it's input from webservices and saves proccessed info to SQL2005 database. First I deserialize the webservices envelope, then iterate over elements I care about and then call a stored procedure to save the processed info. Problem is - dates sometimes don't parse correctly.
After I get the date element from XML, I converted it to .NET datetime by first checking if it's a datetime using DateTime.Parse() and checking if conversion from text was successful (if not, some other value from earlier data is used). Then I use Convert.ToDateTime() to actually convert it to datetime.
Works fine. BUT. If I put the program on another machine (a server to be exact), from time-to-time, some dates do not get converted (DateTime.Parse wont cooperate when checking if conversion is possible). I suspect it might have something to do with globalization (as they DO get converted on MY machine, but not on the other) but other than that, I have no ideas.
To counter it, I thought of trying to Convert the datetime using XmlConvert.ToDateTime() but that failed, too. Then I tried to convert it using DateTime.ParseExact() like this:
IFormatProvider format = new System.Globalization.CultureInfo("en-US", true);
DateTime.ParseExact(xmlDate, pattern, format, DateTimeStyles.AdjustToUniversal);
However, then I got an exception complaning that DateTime has to be between 1773 and 9999 or something like that, which totally freaked me out as debugging showed that my datetime that generated such an error was something like 2. december 2008.
Any ides ?
Best wishes from Tallinn, Estonia
|
|
|
|
|
A) Always use an ISO 8601-compliant format, particularly in XML and when international communication is involved.
B) Yes, DateTime is affected by the system's "Regional and Language Options". I always set Short Date Format to yyyy-MM-dd with -
|
|
|
|
|
hi all,
i want to run the slide show say ten slides and then close it programaatically , but in my code given below it opens the slide show and closes immediately ... ..
please give me a solution to this problem
Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
ppApp.Visible = MsoTriState.msoTrue;
Presentations ppPresens = ppApp.Presentations;
Presentation objPres = ppPresens.Open(fullPath, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
Slides objSlides = objPres.Slides;
Microsoft.Office.Interop.PowerPoint.SlideShowWindows objSSWs;
Microsoft.Office.Interop.PowerPoint.SlideShowSettings objSSS;
objSSS = objPres.SlideShowSettings;
objSSS.StartingSlide = 1;
objSSS.EndingSlide = objSlides.Count;
objSSS.Run();
objSSWs = ppApp.SlideShowWindows;
for (int i = objSSS.StartingSlide; i <= objSSS.EndingSlide; i++)
{
System.Threading.Thread.Sleep(100);
}
objPres.Close();
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(objPres) > 0) { };
objPres = null;
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(ppPresens) > 0) { };
ppPresens = null;
ppApp.Quit();
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(ppApp) > 0) { };
ppApp = null;
I have tried with
System.Threading.Thread.Sleep(10000);
but not worked.
|
|
|
|
|
|
kirandilip wrote: the date difference between two datetimepickers is lessthan 7 then only application run otherwise to display a error message
I didn't get your above line.Can you be more specific.Application run means?
Cheers!!
Brij
|
|
|
|
|
I guess the point is some kind of a trial protection...
Regards,
Lev
|
|
|
|
|
Check the DateTime and TimeSpan structures
Regards,
Lev
|
|
|
|
|
Hi
I have to insert value in db from textbox which create at runtime i have done the coding the for creating it
but need help in inserting value in Database?
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
if (txtbox.Text != "")
{
CreateControl();
}
}
}
private void CreateControl()
{
TextBox txttest;
LiteralControl LCT1;
for(int i=0; i <= Convert.ToInt32(txtbox.Text)-1;i++)
{
LCT1=new LiteralControl ();
LCT1.Text=" ";
txttest=new TextBox ();
txttest.ID="txt"+ (i+1);
Panel1.Controls.Add(LCT1);
Panel1.Controls.Add(txttest);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
for(int i=0; i<= Convert.ToInt32(txtbox.Text)-1;i++)
{
TextBox txtCntrl=(TextBox)Panel1.FindControl("txt"+(i+1));
if(txtCntrl != null)
{
TextBox tbox = new TextBox();
tbox.Text=tbox.Text + "tbox"+txtCntrl.Text;
}
}
}
any help
|
|
|
|
|
your main issue, apart from variables with names like Panel1 and txtbox ( and code that will blow up if someone types a non number into a textbox ) is that you're asking ASP.NET questions outside the ASP.NET forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi all,
Can anybody tell how to hide the query string in the url and how to make the website working on the https.
Thanks
|
|
|
|
|
HTTPS is just a secured website, you'll need a certificate and it's not too difficult using IIS.
Hiding the QueryString requires URL Rewriting, CP has some good articles.
Now you should have some search terms for Google and CP.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
Thanks for the answer but I had some queries :-
(i)
I had created the certificate by right clicking the Default web site icon in the iis but i donot no how to use it for my website.
(ii) I had used the server.transfer to hide the query string on the first page load it does not show query string but when button is clicked it again shows the query string.
Thanks
|
|
|
|
|
tauras81 wrote: I had created the certificate by right clicking the Default web site icon in the iis but i donot no how to use it for my website.
Just access your website with HTTPS.
tauras81 wrote: I had used the server.transfer to hide the query string on the first page load it does not show query string but when button is clicked it again shows the query string.
If you feel query string is insecure, why not using other state management techniques?
|
|
|
|
|
Again, you can use Google to find out how to do the HTTPS side of it, and search for articles here on CP that have to do with URL Rewriting.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
As others have said, if you are scared of putting stuff on the URL, then don't put it there. Use the session instead. Typically you shouldn't have to put much in the session, but anything that is a security issue, goes there.
Just to add, you're lucky to get so much help, given that you asked in the wrong forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Guys,
How to match single specified character with regular expression?
E.g. I should be able to get string with single slash only "\something" not something "\\something".
Thanks.
|
|
|
|
|
Search for the slash followed by any character that's not a slash. There's a great program called Expresso you can get from CP and elsewhere, it really helps with building regex.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello
I have 2 tables: Comperitor(idcompetitor, Name, Adress) and Competition(idcompetition, About, Town). Between them is a also table named Participate(PFK idcompetitor, PFK idcompetition, Date)[because relationship is N:M]
I have those tables on my sql server 2005 and on dataset inside vs.05. I put a Datagrid on my form and tryed to fill data from table Participate to my datagrid. I achieved but values were afcourse only ID-s of competitor and competition...So i tried to create new tableadapter with his own sql statemetn : SELECT c.Name, cs.About, p.Date FROM Competition c, Competitor cs, Participate p WHERE c.Idcompetitor=p.Idcompetitor AND cs.idcompetiton=p.idcompetition. When called tableadapter.Fill method on this datatable wverything is fine but what to do when you want to update values on table participate with this datagrid is that possible or there is another way of doing?
|
|
|
|
|
Ain't me babe wrote: there is another way of doing
There are many ways of doing this, you have asked for an opinion on one of the basic precepts of developing applications, how to manage my data. It is unlikely you can get a satisfactory answer via a forum. This takes some years to get a good handle on.
It looks like you are doing all your data manipulation in the UI whereas most people will do it in the database or the object layer. EG I would have created a view in SQL to service the grid, but then I would not have used a grid in the first place, I would use a treeviw and implement drag and drop from listviews of players and comps.
You are also relying on the UI data controls to do your work - this will hurt you will quickly find their limitations (about now). Look into Data Access Layer (DAL), it is a complete change from what you are doing but will serve you in the future.
Good luck
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
Im experimenting with multithreading , now I have a question relating to a sample project that I did.
heres my code...
using System.Threading;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Thread threadone = new Thread(new ThreadStart(ProcessOne));
threadone.Start();
Thread threadtwo = new Thread(new ThreadStart(ProcessTwo));
threadtwo.Start();
}
public void ProcessOne()
{
for (int i = 0; i < 10; i++)
{
while (i)
{
}
DropDownList1.Items.Add(i.ToString());
}
return;
}
public void ProcessTwo()
{
for (int i = 10; i < 20; i++)
{
DropDownList2.Items.Add(i.ToString());
}
return;
}
}
Ive got two dropdown lists that I populate with numbers, yet the result is different each time I run the program.
Sometimes one list is populated and the other is isnt and vice versa.
I guess the main question Im asking is how I make it consistently populate both of the lists each team.
Could somebody explain how this would be inappropriate and when is the best times to use multithreading?
Kind Regards
|
|
|
|
|
The best time to use threads is when you have some long task that needs to be done while the user can still play around with the GUI.
I also use it alot with web browser type stuff, web scraping for example. I had an app where I needed to scrap like 5000 web pages for simple data off each, so I multithreaded it to run like 75 at a time, drastically reducing the wait time needed to run.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thanks for the advice, so its best to use it when doing big tasks.
As for my code I posted, could you somehow explain why the lists sometimes get populated and sometimes it doesnt?
Kind Regards
|
|
|
|
|
It could be that the thread doesn't get its work done before the form draws itself. That would be my guess.
When working with threads, you need to make sure that each thread only messes with stuff that is on its own thread. Google thread safety and you should find what I am talking about. Fix that and it may work, if not, force the form to redraw itself after you add things to the list.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|