|
Hi!
Yes, starting can be a bitch...
You can't say one choice is "the correct" way, because you can achieve what you want in many different ways.
You can use the OleDB* classes to communicate with a SQL Server just like you would with Access. The only thing that's different (in the beginning, at least) is the connection string you'll have to specify.
With an mdb file you just include datasource='...path to your file...', but that doesn't work with SQL server.
Since I can't remember all the parts of a connection string for a given database, I usually take a look at http://www.connectionstrings.com/[^] to find the correct connection string.
Everything else is just a matter of reading the class documentation...
Regards,
mav
|
|
|
|
|
Hi Guies,
How to read integer from keyboard in C#.
Thanks in Advance...
|
|
|
|
|
For console programing you hava to use
using System.Console.;
& then use
ch = System.Console.Read(); //return charater
Or
str = System.Console.ReadLine(); //return string
Divyang Mithaiwala
with Best Regards
|
|
|
|
|
I want to take integer value and not char or string.
Actually System.Console.Read() reads kay pressed and not int.
|
|
|
|
|
Then use int.Parse() to convert it.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
if you are trying to accept only numeric values in your text box, you can use the e.Handle = true of KeyPressEventArgs to cancel the keypress event.
You can try the code below.
string strnum = "0123456789";
if (strnum.IndexOf(e.KeyChar.ToString())<0)
{
e.Handled = true;
}
|
|
|
|
|
i m working with InternetExplrer for that i m using ShDocVw.dll.following coding is used to get the reference to currently opened browsers. what i m doing is putting the entry of brower in listbox.for e.g suppose i write www.yahoo.com in address bar then i put www.yahoo.com in listbox. in the following code ie.LicationURL return the website name in my case www.yahoo.com as i mentioned above. what i did is put all th entries of opened browser into the listbox.when i click on any of the URL in list box . what would i like [b]shows that browser on TOp of all other browser.[/b] for that i used the following coding...
foreach (SHDocVw.InternetExplorer ie in shellWindows)
{
string filnam = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
if (filnam.Equals("iexplore"))
{
if(this.listBox1.SelectedItem.ToString().Equals(ie.LocationURL))
{
MessageBox.show(ie.LocationURL.ToString());
// what code should be here to put the browser on top
}
}
}
Above mentioned code is working fine but is not giving desired ouput
Amit Grover
CDAC R&D
|
|
|
|
|
Can anyone tell me how, if it is possible, to pass a method as an argument for another method?
|
|
|
|
|
Hello,
Firstly define method type:
public delegate int TypeName([Type arg[,[Type arg,...]]]);
This is your method type.
Now define one object of this type
private TypeName myObject;
& also define one method which has declaration as your method type
Note: Object & method are different so use different names for them.
Now initialize object
myObject = new TypeName(MethodName);
now you can pass this object as argument & use same methodtype for calling method for that argument.
Divyang Mithaiwala
with best regards
|
|
|
|
|
Thank you Divyang Mithaiwala, very much appreciated.
|
|
|
|
|
Use a delegate:
class A
{
public delegate void SomeDelegate();
public void MethodWithDelegateParam(SomeDelegate del)
{
del();
}
}
and in client code:
class B
{
public void MyMethod()
{
DoSomething();
}
public static void Main()
{
B b = new B();
A a = new A();
a.MethodWithDelegateParam(new A.SomeDelegate(b.MyMethod));
}
}
[^] For more information.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Thank you Michel Prévost, very much appreciated.
|
|
|
|
|
I am working on a web browser project, i have done the work as when new tab button is clicked, a new tab is created with a browser, but the navigation occurs only in the first tab browser. Is there any way to correct it?
|
|
|
|
|
I don't have the detail of your project and what technology you are using to achieve the display of HTML, but I suspect that you don't keep track of the currently active tab page. What I suggest is that you have a private variable that keeps track of all the tab pages (a collection, for instance) and another one to keep track of the current tab page index. When the user creates a new tab, update your variables accordingly.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
I am working with C#.NET windows application & using the explorer given in the tools to navigate.
|
|
|
|
|
I keep getting the above message on a C# program.
What assembly/namespace have I missed?
|
|
|
|
|
If you had checked the documentation for the DescriptionAttribute class, you would have seen that it's in the System.ComponentModel namespace.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I would please like anyone's help. I need to convert any .PDF file into a .EMF. Enhanced Meta File. The reason being is so that I can edit and manipulate this PDF's data. I need something this is preferably free and code available.
Any help will be greatly appreciated. Tks
-- modified at 3:20 Friday 20th January, 2006
|
|
|
|
|
I wrote a small web application that will be used by few people. I would like to write a small program to install it to different computers. I am very new in this industry so any idea how I can do that
|
|
|
|
|
A WEB application? You can still create an installer, but the app is installed to the IIS Server, not the clients.
All you do is add a Setup project to your Solution. Right-click the Solution in the Solution Explorer, select Add New Item. Under "Other Project Types", you'll find Setup and Deployment. Setup Wizard would be a good one to pick for your first time doing this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for replying.
I did just that and the options I get when I select Add New Item doesn't
give me the option "Other Project Types". I right clicked on the solution.
Is there anything I am doing wrong
|
|
|
|
|
You have to right-click the very top line of the Solution Explorer. Add, Add New Item, then you'll see either a Other Project Types or Setup and Deployment or both.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks it works perfectly
|
|
|
|
|
I'm getting some problem to bind my DropDown control with an xml file...
I made an example using xmlTextReader displaying it in a table format. its working...
But i need to display data in my dropdown control using xmlTextReader....
please help....
here is my example coding...
private void Page_Load(object sender, System.EventArgs e)
{
// Placer ici le code utilisateur pour initialiser la page
string strAtt,strType,strName,strValue,strTemp,strPath;
strPath=Server.MapPath("list.xml");
System.Xml.XmlTextReader xmlRdr;
xmlRdr=new
System.Xml.XmlTextReader(strPath);
strTemp="<table border=1 width=100%><tr><th width=150px>ISBN No.</th><th>Book Name</th></tr>";
Response.Write(strTemp);
while(xmlRdr.Read())
{strType=Convert.ToString(xmlRdr.NodeType);
strName=xmlRdr.Name;
if(strType=="Element")
{
if(strName=="subject")
{
strAtt=xmlRdr.GetAttribute("name");
strTemp="<tr><td colspan=2 align='left' bgcolor='pink'>"+strAtt+"</td></tr>";
Response.Write(strTemp);}
else if(strName=="book")
{
strAtt=xmlRdr.GetAttribute("isbn");
xmlRdr.Read();
strValue=xmlRdr.Value;
strTemp="<tr><td>"+strAtt+"</td><td>"+strValue+"</td></tr>";
Response.Write(strTemp);
}
}
}
Response.Write("</table>");
xmlRdr.Close();
}
and now how will i change this code to display in a dropdown control????
-- modified at 3:07 Friday 20th January, 2006
|
|
|
|
|
Hi all,
How can i add a user control as a treenode to a TreeView control using C#.
What are all the steps that i need to take in order to accomplish the above task?
Any examples or links will be helpful.
Thanks in Advance
Phani Kiran K.
|
|
|
|