|
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
|
|
|
|
|
|
I will be sure to have a look at the reference. Thanks again!
|
|
|
|
|
No problem, I haven't used multithreading too extensively either, but some of the stuff you'll be doing as you learn it I should be able to help with, just post here on CP and your sure to get help.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
two or more threads will execute their code at their own pace; the exact sequence of things overall cannot be predicted unless you enforce some ordering by synchronizing the threads.
Their independence is their biggest advantage, one thread could be searching a disk while another is crawling the web, all have their own unpredictable delays.
If you must protect a shared data structure against inconsistencies, or if your overall logic requires sequential access for some reason, you need synchronization (with locks, mutexes, whatever).
|
|
|
|
|
So I guess that it is kind of pointless to have multithreads if they all do the same thing, whereas they are more useful if they do different tasks.
Thanks
|
|
|
|
|
Hi,
it may make sense to have a few identical threads that each execute a sequence of various operations, say some calculations, some disk I/O, some networking; even when they start in sync, they will evolve differently and may well end up with one performing calculations, one waiting for the disk, and one waiting for the network; each in turn shifting their roles.
But indeed the more natural situation is where different kinds of things are organized in separate threads: one calculating, one performing disk I/O, one taking care of the network, etc.
BTW: that is what OO principles automatically make you do anyhow; the disk is an object, and you give it some threads if that seems appropriate; the network idem; etc.
|
|
|
|