|
Theres a ConnectionStringBuilder class in the framework somewhere that acts like a dictionary. Then you can add the machine name on at runtime.
|
|
|
|
|
Specify localhost as the server?
I use custom configuration files; if the program can't find the file it pops up a dialog to get the names of the server and database from the user then stores that information in the configuration file.
|
|
|
|
|
Hi All,
I am using Dundas for creating Chart. i am facing one problem. i have created one bar chart with one series. Now some bars are coming with one color.Now what i want is to set the color dynamically of all datapoints with different color.How will i achieve it when i have only one series. Can anybody tell me how can i set the different color for all the datapoints in single series.
Thanks in Advance
Avesh
|
|
|
|
|
You should really ask this on the dundas support forums. Application/vendor specific problems are normally best dealt with by the relevant team.
|
|
|
|
|
hi
my aim is to store(transfer) the data from sql server 2005 database into excel file if any one is having any idea abt this then plz do let me know ...
regards
sindhu tiwari
ek jahaan mukkamal nahi hai zindagi ....jahan aur bhi hai is jahaan se aagey
|
|
|
|
|
You can use either Excel object model or Ole DB driver for excel to write to an excel file
|
|
|
|
|
This question has been asked hundreds of times, try searching Google[^], articles, or the forums.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
How can i change the system date style formate through code.
I have a project when it starts it compare the current date withe the condition date is the date formate is wrong it give error plz help me out.
|
|
|
|
|
|
Thanks for providing such a good link.
But my problem is not getting system data formate.
Because in Microsoft.Win32 Api there is method
GetSystemDateFormate
but there is not Setting the System Date formate
Can you help me out form this problem.
|
|
|
|
|
You shouldn't change the system's format!
Instead:
1. Retrieve the current date
2. Reformat it to the format you require
3. Compare
If you use the DateTime.Parse() method you shouldn't even need to do this as it will handle all date and date/time formats for you.
|
|
|
|
|
You asked the same question yesterday and were informed that this was not a good idea back then. Why do you think you'll get a different answer today?
The simple answer is that your application should not change the behaviour of the system to suit itself - this is a bad thing to do because you are upsetting the customer experience of the system. Instead, you need to bite the bullet and actually do some work yourself - if your code requires a particular date format, use the DateTime class to manage this in your code. This is the responsible, professional thing to do and you could have achieved this in the time you've spent faffing about trying to get people to tell you how to upset your users.
|
|
|
|
|
How to remove the databinding of the textbox control at runtime?
Jo
|
|
|
|
|
textBox1.DataBindings.RemoveAt (0);
123
|
|
|
|
|
but, it is not working.......
Jo
|
|
|
|
|
For my game I created a class called "Integer" to use with by ComboBox. For somereason the ComboBox says "TANK.Integer".
<br />
class Integer<br />
{<br />
public int value;<br />
<br />
public Integer(int value)<br />
{<br />
this.value = value;<br />
}<br />
<br />
public int Value<br />
{<br />
get<br />
{<br />
return this.value;<br />
}<br />
}<br />
<br />
new public string ToString()<br />
{<br />
return this.value.ToString();<br />
}<br />
}<br />
In the constructor that is used in Application.run I call:
<br />
MessageBox.Show(Game.grid_height_configurations[0].ToString()); <- An array of "Integers"<br />
It says "TANK.Integer" instead of calling Integer's ToString method. It's probably something small.
|
|
|
|
|
In your integer class, you should override the ToString() method:
<br />
public override string ToString()<br />
{<br />
return this.value.ToString();<br />
}<br />
|
|
|
|
|
Heh I was right it was something small. Thanks.
|
|
|
|
|
and you should not ignore (or suppress) compiler warnings either. it did tell you what was probably wrong.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
There were no compile error/warnings. Whenever I make a program I make it a practice to have no compile errors/warnings.
|
|
|
|
|
object.ToString() is an existing virtual method; adding a ToString() method to some type therefore
requires either the "new" or the "override" keyword, and such is indicated by the C# compiler in all
Visual Studio versions I have seen so far, provided the warning level is set sufficiently
high (I run mine at the maximum value, which is 4), and the specific warning is not suppressed.
The exact message is:
warning CS0114: 'XXX.ToString()' hides inherited member 'object.ToString()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I'm having a strange problem in my project that I do not understand.
I have a bunch of buttons in a master page that every page uses. When the user presses return in one of my search field (to query data) in a page that uses it, the page_load of the master page fires, and for some reason, the first button is being somehow clicked and the user is redirected to the page of the first button in the master.
Here is the code in my master page:
void Page_Load(object sender, System.EventArgs e)
{
string path;
if (!IsPostBack)
{
path = Request.Url.Host;
// If the user_id was not set, this means that the Default.aspx form
// was not run and no valid credentials. Redirect user back to the Default page to validate
// credentials. If running on a local host, don't worry as this is the developer.
if (path != "localhost")
{
if (Session["user_id"] == null)
{
Response.Redirect("Default.aspx");
}
}
}
return;
}
protected void test()
{
return;
}
protected void imgbtn_accounts_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("AccountList.aspx");
}
imgbtn_accounts_Click is always being activated.
Here is the asp code in the master page:
asp:ImageButton ID="imgbtn_accounts" Tabindex="1" style="position:absolute; left: 270px; top: 41px;" ImageUrl="~/Images/Accounts.gif" runat="server" OnClick="imgbtn_accounts_Click" />
When I take away the OnClick="imgbtn...", the behavuior goes away but then my imgbtn_accounts becomes useless.
Does anyone have any idea why this is occurring?
Thanks,
Garry
|
|
|
|
|
I need to create this program and needs to have if, else statements.
Could you please help me?
I want to create a program that will look like that?
Welcome to HollowRectanglePrinter!
How many columns wide should the rectangle be? 6
How many rows tall should the rectangle be? 4
Here you go:
******
* *
* *
******
|
|
|
|
|
OK - for a starter if/else statements aren't loops. They're conditional statements. Next, we won't do your homework for you - and this is so obviously a homework assignment. Finally, if you can't solve a basic problem like this quickly then you really shouldn't be aiming at a career in programming.
|
|
|
|
|
(I agree that it looks like homework.)
Loops? Plural? I can do that without loops.
P.S. Without conditionals as well.
P.P.S. And no recursion either for that matter.
|
|
|
|