|
How to get the IP of SqlServer?
Can you help me?
Jiw
|
|
|
|
|
I'm curious as to why you want the IP address of the SQL Server.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Because i want to copy files to server,but i don't know how to get the Path.
|
|
|
|
|
Getting the IP of the Server will not get you the path... The IP and ServerName are completely interchangable in paths:
\\xxx.xxx.xxx.xxx\share\dir\dir\dir\file
is exactly the same as:
\\servername\share\dir\dir\dir\file
since the system will resolve the servername to it's IP address for you, automatically...
RageInTheMachine9532
|
|
|
|
|
If you know the host name already, you can use Dns.GetHostByName to get the IPHostEntry , from which you can get the IP address. You really don't need it for ADO.NET, though. Just use the SQL Server name and instance (if any besides the default instance).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
dear there,
i have a dataset with a table.I need to bind this untyped dataset to a datagrid.
on runtime i need to show i record number along with records.
That is serial number to every record in datagrid
hai, feel free to contact for any support provided that must be my level of knowledge
Sreejith SS Nair
sreejith@neosoft-tec.com
|
|
|
|
|
Without owner-drawing the DataGrid (which could be pretty difficult), you could extend DataGridColumnStyle with a row that displays an incremental value. Use the DataGrid.TableStyles to add a DataGridTableStyle that has the columns you need, including your DataGridColumnStyle derivative that displays the row number as the first column (or wherever you want it). If you allow sorting and what the row indexes to keep in sync, then you'll need to add a little intelligence to your DataGridColumnStyle derivative that uses the row's index in the DataTable . See the documentation for the DataGridColumnStyle for more information and an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi everybody!
Ijust started studing programming in C#. I so in some source code they are using namespaces: Microsoft.DirectX, Microsoft.DirectX.DirectSound. I'm using .NET 2003 and I thought that I had all libraries, but my namespace Microsoft has only CSharp,VisualBasic and Win32 libraries.
Question: where I can get, or how I can reference Microsoft.DirectX?
I also have question about saving image when it was loaded into pictureBox from file using
image.fromFile(...) function,if I want to save it in the same file and use image.save(...) function passing same file name, i'm getting error msg that file is used by another program(apparently fromFile() did not close file, and I have no handle to this file to close it).
Question: Is there a way to save it into the same file?
And last question: If I downloded image (jpeg) as a bitmap
can I select some polygones on image and change its colors
dynamicaly?
Thanks
|
|
|
|
|
For the first question:
You must download the DirectX SDK 2003 summer update.
You can obtain it here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9216652f-51e0-402e-b7b5-feb68d00f298&displaylang=en
As for the second: you can copy the image from a PictureBox to a temorary BitmapImage object and then dispose the PictureBox, and then save the image.
For the tthird; you mean pixels, right? I know it can be done, but I am not shure if it can be done directly on the PictureBox object. Maybe someone else will anwser you this question ...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You could also Clone the image, then save it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Any tutorial on regular expressions is likely to use this as an obvious example.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hi,
I'm new in C# programming, I created an array using ArrayList.Add() function to insert that structure in the array
<br />
public struct LineToCheck<br />
{<br />
public string fileName;<br />
public ulong CRC;<br />
public LineToCheck(string filename,ulong CRC)<br />
{<br />
this.fileName=filename;<br />
this.CRC=CRC;<br />
}<br />
}<br />
my question is........how I access to that structure from the array???
I tryied to use array[0]. but I can't see structure... I can't also understand how to use the array.ToArray() function..... since I don't use int or chat array.... thanks in advance
Paolo
|
|
|
|
|
Because there are no templates, your container has no idea what it contains, it just knows it contains objects ( because everything is an object ). So, in order to use what is in your array, you need to do one of two things:
1. Contain an ArrayList in a class called LineToCheckArrayList, or whatever, so that it's access methods are strongly typed
2. Cast the return from the ArrayList every time you use it. To be really correct, you should us the 'as' keyword ( i.e. array[0] as LineToCheck, not (LineToCheck)array[0] ), which will not blow up, but return null if the object is not of the type you expect. Obviously, this is not a good idea unless you intend to check the type yourself. You can use the 'is' keyword for this, as in if(item is LineToCheck).
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
:-Dusing System;
//namespace for ArrayList
using System.Collections;
namespace ArrlistVSStruct
{
//your struct signature
public struct LineToCheck
{
public string fileName;
public string CRC;
public LineToCheck(string filename,string CRC)
{
this.fileName=filename;
this.CRC=CRC;
}
}
class Class1
{
static void Main()
{
//Arraylist creation.
ArrayList Arlist=new ArrayList();
declaring three variable of the type LineToCheck
LineToCheck LC1,LC2,LC3;
//assigning values to struct
LC1=new LineToCheck("ha ha","hi hi");
LC2=new LineToCheck("hey hey","ho ho");
//adding to arraylist
Arlist.Add(LC1);
Arlist.Add(LC2);
//getting the values out
for(int i=0;i
|
|
|
|
|
I seen on msdn that you can use the setup.exe bootstrapper to make a setup program detect if the dotnetfx framework is on the current computer and if its isn't it will install dotnetfx.exe. That sounds wonderful. I just don't see anything on there about actually how to do it. I tried using the setup wizard its just not clear to me. If i really knew a keyword to search for or something that would be great.
I have my project complete and would like to distribute it but I don't need my clients searching all over the internet for the dotnet files. I want it to install everything they need. if there is a good tutorial on using the setup wizard that would be great and please DON'T DIRECT ME TO MSDN that site might be great but in all honesty i go in there trying to learn how to write my name and by the time i get done reading i've done forgot the alphabet.
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
The bootstrapper is a program that checks for the .NET Framework installed on the machine running your setup .MSI. If it is not there, the bootstrapper launches the install dotnetfx.exe to install the framework. If it is there, then it simply launches the .MSI Installer for your app.
You might want to look at the GotDotNet Bootstrapper Plugin workspace here[^].
RageInTheMachine9532
|
|
|
|
|
First, some actual resources for those willing to learn to research
Read This
Now step by step:
Read the article called "Using Visual Studio .NET 2003 to Redistribute the .NET Framework"
Download the plugin for VS 2003
NOTE: You will not notice anything visibly different with your installs. There's no pretty wizard or anything.
However, when you compile your application you will notice that the setup contains the dotnetfx.exe file in it as well as a few others. You can zip up the whole lot of 'em and just have users run setup.exe
Of course by doing this your distribution size just grew by 23 megs or so...
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
Hi,
When I bind a textBox control's text property to a DataSet, it works well. But when I use
this.BindingContext[dataSet11.tbl_name].Position++(--) set the postion , the textBox control can't update the content. Would you please tell me how to solve the problem.
In addition, if I bind the same dataset to a listbox control, and use mouse to select the listed item, the textbox's content can change. Why????????
Thank's a lot!!
Alan Shen
|
|
|
|
|
When using the BindingContext , you must use the same data as you bound against. If you bound to the DataSet itself, then don't use tbl_name (whatever that is supposed to represent; hopefully the strongly typed DataTable in a typed DataSet ).
If you use the same binding context that the control is bound to, simply incrementing or decrementing the BindingManagerBase.Position will update the data in the data-bound controls bound to that binding context.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks a lot!!
And there is another question.
if I use the following two clauses, the data-bound control can not update.(Because I am using two different BindingContext objects)
1. this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "Test.id"));
2.this.BindingContext[dataSet11.Test].Position --;
But if I change 1 to 3, the control can update itself.
3.this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11.Test, "id"));
Why????
I am still using two different BindingContext objects.
|
|
|
|
|
No you're not, actually. Both 2 and 3 bind to dataSet11.Test , where 1 binds against dataSet11 . That's the difference.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
User machine had .NET framework version 1.0 on his machine. Later after it was updated to version 1.1, my application started to behave erratically.
The main erratic behaviour was in firing of event.
When the form loads, I programmetically sets the selectedIndex for ComboBox, which then fires SelectedIndexChanged event. This was the normal behaviour.
But now setting the selectedIndex for ComboBox programmetically doesn't fire the event.
When I go to help-->About in ".Net Framework development environment" I see the version 1.0 (1.0.3705), which means appliction was built on version 1.0.
Target machine has both 1.0 and 1.1, and from Micrsoft website I found that application built using 1.0 deafult to 1.0 framework.
http://msdn.microsoft.com/netframework/technologyinfo/versioncomparison/default.aspx[^]
Any pointers for this erratic behaviour
|
|
|
|
|
Yes, the frameworks do run side by side and your application will use the version it's built against if available. If not, it will use a newer one or whatever you configure as a supported runtime in your app.config file.
If your application is behaving eratically, it's possible that 1.1 was not installed correctly, but I've only seen this when installing in reverse order (doesn't happen all the time, but seems pretty common). You might want to add code in your application (even if all it doesn't is use the DefaultTraceLister a la Trace.WriteLine ) to list the assemblies currently loaded into your default AppDomain, along with their versions. Version 1.0.3705.0 (hopefully .228, which is 1.0 SP2) is .NET 1.0 and 1.0.5500.0 is 1.1.
As far as the specific event problem you mentioned - are you sure this is the same codebase? The event hasn't changed from one version to the other, nor will it most likely (for backward compatibility).
The only other thing I can think of is that something else was hosed on this system. The Windows Forms controls encapsulate the Windows Common Controls (native controls). If the machine got screwed up somehow - though you'd most likely notice in other applications - the controls might not work correctly, and would most likely fail all together.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
On my machine I tested the application by modifying <appname>.exe.config file. When I force it to go to version 1.1, it gives the same erratic behaviour (i.e. not firing SelectedIndexChanged event)
<code><startup>
<supportedRuntime version="v1.1.4322" />
</startup> </code>
So to me it looks like, it is backward compatibility issue. For now I will include following in <appname>.exe.config file on client machine.
<startup>
<supportedRuntime version="v1.0.3705" />
</startup>
If really this is an issue (and not something that I am missing), it will lead to compatibility problms.
Thanks Heather for your feedback
Ruchi
|
|
|
|