|
No You have a error in Connection String pls modify ur Connection String like that:
SqlConnection objConnection = new SqlConnection(
"server=localhost;database=pubs;uid=sa;password=if any");
Regards,
Karthick
Iam Karthick from Chennai Dot Net Developer
|
|
|
|
|
"User ID" is a valid property to have in the connection string, and the concatonation shouldn't cause any issue either.
http://www.connectionstrings.com/[^]
Which part did you think was incorrect?
-- modified at 9:34 Monday 30th July, 2007
Opps that didn't sound quite how I ment it. What I ment to say was:
Is there something wrong that I missed?
|
|
|
|
|
Hi!
I working on a Pocket PC Device application and i need help
How to verify if another instance of my program is already running? And if another instance is already running I want to make the one already open to get focus.
Please hep me!
Thank you
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
Hello,
Look at System.Diagnostics.Process!
There you will find "GetProcessByName".
Look also at this answere I gave some time ago:
MainWindowHandle[^]
All the best,
Martin
|
|
|
|
|
I am writing following code for impersonation but it doens work.
Can anybody tell me why?
serverConn = new ServerConnection();
serverConn.LoginSecure = true;
serverConn.ConnectAsUser = true;
serverConn.ConnectAsUserName = userName + "@" + userDomain;
serverConn.ConnectAsUserPassword = userPassword;
This connection is used tofr creating database.
Please help
Nana
|
|
|
|
|
hi
Sir,
I have created a Sample Application where a fonts file is referenced from
C:\WINDOWS\Fonts
my requirment is in that my Sample Application should not
use from C:\WINDOWS\Fonts\*.tff path
it use the fonts file *.tff from SampleApplication.resx file
so that my SampleApplication can get fonts irrespective of
font installation in C:\WINDOWS\Fonts
thank u
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
I would appreciate if someone here can help me with the following:
I need to write a small program in C# that does the following:
1. Collect from a user 2 numbers (different bases - Bin, Oct, Dec or Hex) and store them in integer
2. Then collect the operator from the user (+, -, *, /)
3. Then collect in what base the result will be presented (Bin, Oct, Dec or Hex)
4. And then print the result
No graphics is required here. Something to run from the command line.
I know it is simple but could not figure how to do it,
I would appreciate your help here,
Thanks,
Dana.
|
|
|
|
|
So where are you stuck exactly? We won't write the entire code for you.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How do I take the 2 numbers from different bases, do the addition for example and present it in a different base?
|
|
|
|
|
guyav99 wrote: How do I take the 2 numbers
Console.ReadLine
guyav99 wrote: from different bases
Depends on how you represent them. You can use string parsing methods or int.Parse()
guyav99 wrote: do the addition for example
Convert them to the same base and use +
guyav99 wrote: and present it in a different base?
number.ToString() with a format specifiert should do the trick
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Parse the strings into numbers using the selected base, do the addition, and convert the numbers into strings useing the selected base.
The Convert.ToInt32 and Convert.ToString methods have overloads that handle different bases.
---
single minded; short sighted; long gone;
|
|
|
|
|
OK, lets assume I collected 101 in base 2 into num1 and 75 in base 8 into num2
How do I write the code for the conversion, adding the two numbers and put the result in a base from the user (say $base_result)
|
|
|
|
|
I have told you how to do it and what methods to use for it. Can't you at least make an attempt at writing some code yourself, before asking?
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for the info, however I'm not sure how to do it.
I looked at MSDN and tried to learn from there but still couldn't understand how to do it.
I wouldn't come to the forum if I knew
|
|
|
|
|
Homework?
Standards are great! Everybody should have one!
|
|
|
|
|
Not at all.
I'm trying to build a calculator that can do multiple stuff and this is one of them.
As you can see, I don't ask anyone to program it for me. This is only a small portion of it.
|
|
|
|
|
Ok, just wondering, sounds like one of my old homework questions. Use String.Format to convert from decimal to hex. You can use int.Parse to get the decimal value back.
Standards are great! Everybody should have one!
|
|
|
|
|
Hello,
Here an example for Hex and int:
public string Int64ToHex(System.Int64 number)
{
return String.Format("{0:X}", number);
}
public double HexToInt64(string hexString)
{
Int64 actint=0;
if(hexString!=null && !hexString.Equals(string.Empty))
{
try
{
actint=System.Int64.Parse(hexString, System.Globalization.NumberStyles.HexNumber, CultureInfo.CurrentCulture);
}
catch
{
}
}
return actint;
}
I'm using .Net 1.1, so there is no Int64.TryParse, and with double.TryParse it doesn't work.
All the best,
Martin
|
|
|
|
|
|
If you would have gone to class you'ld probably have known...
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
Hello
I'm looking for a tool for localizing my application. Before entering the .Net world I used gnu GetText, but it doesn't seems to be used for .Net, even though I think it supports it.
I'm looking for a great localization tool, I don't just want to edit the resx file in Visual Studio.
Any suggestion, either open source or below 100$ for a single user license?
|
|
|
|
|
hi all
i want to know how we can find all the text box controls on
a windows form ...
i know how to do it in a web applications but the same logic doesnt workout for windows please help me
for web
ContentPlaceHolder cMainContent = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
|
|
|
|
|
foreach(Control c in this.Controls)
{
TextBox actTextbox = c as TextBox;
if(actTextbox!=null)
{
}
}
-- modified at 7:45 Monday 30th July, 2007
This would be the recursive method which had been suggested by "J4amieC":
private void FindAllTextBoxes(Control c)
{
if(c!=null)
{
if(c.Controls!=null)
{
foreach(Control actControl in c.Controls)
{
TextBox actTextBox = actControl as TextBox;
if(actTextBox!=null)
{
}
else
{
FindAllTextBoxes(actControl);
}
}
}
}
}
All the best,
Martin
|
|
|
|
|
Personally I would have illustrated it differently, mainly by building up a List<TextBox> inside the recursive method.... but your example shows the main ingredients
-- modified at 10:41 Monday 30th July, 2007
|
|
|
|
|
Hello,
J4amieC wrote: but your example shows tyhe main ingredients
Actually, if I have to find out all the members of a type, I mostly hold the references in an ArrayList(.Net1.1) for further usage.
But it really depends on the task.
If he is only searching for one special TextBox instance which is somehow marked (over the Tag property for example), then there is no need for holding all the references, I guess.
All the best,
Martin
|
|
|
|