|
How could you tell he was using sql express?
|
|
|
|
|
|
thank you for replies, I'll work on it a bit further,
thanks again =)
|
|
|
|
|
Hi, my friends.
I´m developing a control named TagListControl, quite similar to the control that allows you to assign tags to the posts in Blogger. But I´ve got a problem: the end of the list is hidden because it reaches the end of the GroupBox the control belongs. I´ve tried with BringToFront() method, but it just makes the control stand first in the Z-order of controls inside the GroupBox, not far beyond the GroupBox, as I want to.
Any help will be welcome.
Thanks in advance.
Best regards,
Fernando.
|
|
|
|
|
I'm populating a listbox using it's DataSource property in form's load event
what happens is that the selectedValueChanged event or selectedIndexChanged fires twice when starting the form
how can i prevent such behaviour
i want the event to fire only when user change listbox by mouse
there is an event straight for this(SelectionChangeCommitted), but it's availabe only on combbox control
i need to use listbox for htis.
how can i achive such behaviour
secondly:
when i first run the form, the selectedValueChanged event always fired once again selecting the firs index in the listbox
how to stop this also
i want to run the form without any event being fired unless the user change the value manually
thanks
modified on Tuesday, October 27, 2009 7:04 AM
|
|
|
|
|
Your ListBox is behaving as designed and as far as I am aware it is not possible to stop it.
However one of the many ways to cope with the problem is as follows:
1) Modify the Constructor for your Form
private bool stillInitializing = false;
public MyForm()
{
this.stillInitializing = true;
InitializeComponent();
this.stillInitializing = false;
}
2) Modify your event handler(s)
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.stillInitializing)
{
return;
}
}
Hope this helps!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
didn't work when applied on form construcor
so i tried this
private void Form1_Load(object sender, EventArgs e)
{
this.stillInitializing = true;
unitMeasureCollection.GetMulti(null);
vendorCollection.GetMulti(null);
shipMethodCollection.GetMulti(null);
purchaseOrderDetailCollection.GetMulti(null);
comboBoxUnitMeasure.DataSource = unitMeasureCollection;
comboBoxUnitMeasure.ValueMember = "UnitMeasureCode";
listBoxVendor.DataSource = vendorCollection;
listBoxVendor.DisplayMember = "Name";
listBoxVendor.ValueMember = "VendorID";
listBoxShipMethod.DataSource = shipMethodCollection;
listBoxShipMethod.DisplayMember = "Name";
listBoxShipMethod.ValueMember = "ShipMethodID";
dataGridView1.DataSource = purchaseOrderDetailCollection;
PopulateCategoriesAndSubCategories();
ClearTextBoxes();
DisableButtons();
this.stillInitializing = false;
}
and it worked just fine
thanks, Henry Minute
|
|
|
|
|
Good stuff!
It is nice to attempt to help someone with the intelligence to see the basis of your answer and apply it for their own circumstances.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
HI all....
i really need helping for socket programming ...............
|
|
|
|
|
there is a unmanage library Called WinPcap, search google, download it from http://www.winpcap.org/
then it adds some function to API that you can use them, if you don't know anything about PInvoke, use SharpPcap (Managed Code for winpcap) it is simply a DLL that you can add as reference for your application and use it(Search SourceForge.net to download it), for IP or Ethernet Packet Capturing and sending
|
|
|
|
|
|
You might be wrong with this question in the c# forum
Just google for it, you will find plenty of examples in the net.
I won’t not use no double negatives.
|
|
|
|
|
i have a ajax panel, where i have image buttons and have contents,all i need to add another subheader, can get all the data dyanmically.
All i need to know how do i add another subheader in a header and that too dynamically.I have used google, but was not useful.
And the code for the above is in c#.
anyways thanks. Looking forward for some +ve replies
Thanks
|
|
|
|
|
Even if you're writing your code in C# I believe this question is better suited in the ASP.NET forum since you are developing a web site
|
|
|
|
|
Is there a way to retrieve the data from the service using ServiceController?
1) I've got exception while trying to execute custom commands on the service
2) How to obtain the return code after the external command executed?
The service is LocalSystem one.
I start and stop it from external console application without problems.
But once I add external commands after the service has been started sc.ExecuteCommand((int)Commands.Cmnd1); the exception is being thrown that the service can not be manipulated.
Чесноков
|
|
|
|
|
would you specify the type of exception? maybe you do not have sufficient privileges to execute the commands, for gaining privileged u should add a manifest file to your project
|
|
|
|
|
System.InvalidOperationException
Чесноков
|
|
|
|
|
1) You need to ensure the custom command code is between 128 and 256.Values below 128 correspond to system-reserved values and values up 256 are restricted.
2) It seems that there's no standart framework designed to send and receive data to windows service and back.It's only a few information on the internet for this problem but I believe that it shouldn't be difficult to implement communication with a service based on sockets or named pipes.
[EDIT]
You could also set AutoLog property of ServiceBase class to true to gather information about custom commands execution from the eventlog.
Life is a stage and we are all actors!
modified on Tuesday, October 27, 2009 7:07 AM
|
|
|
|
|
1) They were starting from 0 actually (0,1,2, ...)
2) I needed custom commands to get the feedback from the service, the same as you call ordinary function and it returns some error code. Otherwise I will have to implement such other communication
Looking into logs would sute only for visual inspection.
Чесноков
|
|
|
|
|
As it's mentioned in the documentation here custom command codes should be only between 128 and 256:
The only values for a custom command that you can define in your application or use in OnCustomCommand are those between 128 and 256. Integers below 128 correspond to system-reserved values.
Just take a look to this sample that demonstrates this behavior.
I haven't found almost nothing about sending and receiving that from service but after analyzing some service based apps like SQL Server Db engine I suppose they it uses TCP socket on port 1433 and named pipes to serve the clients.
Life is a stage and we are all actors!
|
|
|
|
|
how to send the message sent from one client to another client, plz help me.
|
|
|
|
|
By writing code. Perhaps you need to ask something more specific ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
there are 2 systems with ips 192.168.1.87(clientA,serverA) and 192.168.1.35(clientB,serverB) . on both the systems client and server runs.
now clientA sends a message to serverB on button click. as soon as serverB recieves a message it should send that message to ClientB
how is that possible
clientA--->serverB(onmessagerecieved)--->cientB
server:-
int recv;
byte[] data = new byte[1024];
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 10294);
Socket newsock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
newsock.Bind(ipep);
newsock.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Any, IPAddress.Parse("127.0.0.1")));
while (true)
{
IPEndPoint sender2 = new IPEndPoint(IPAddress.Any, 0);
IPEndPoint sender1 = new IPEndPoint(IPAddress.Parse("192.168.1.35") , 0);
EndPoint tmpRemote = (EndPoint)(sender2);
EndPoint tmpRemote1 = (EndPoint)(sender1);
data = new byte[1024];
recv = newsock.ReceiveFrom(data, ref tmpRemote);
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
string welcome = "7010";
data = Encoding.ASCII.GetBytes(welcome);
newsock.SendTo(data, data.Length, SocketFlags.None, tmpRemote1 );
}
client:-
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("192.168.1.35"), 10294);
byte[] data = new byte[1024];
Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
private void Form1_Load(object sender, EventArgs e)
{
client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 10);
}
private void button1_Click(object sender, EventArgs e)
{
string welcome = "What's your IP?";
data = Encoding.ASCII.GetBytes(welcome);
client.SendTo(data, data.Length, SocketFlags.None, ipep);
}
private void timer1_Tick(object sender, EventArgs e)
{
IPEndPoint server = new IPEndPoint(IPAddress.Any, 0);
EndPoint tmpRemote = (EndPoint)server;
data = new byte[1024];
int recv = client.ReceiveFrom(data, ref tmpRemote);
this.richTextBox1.Text = Encoding.ASCII.GetString(data, 0, recv);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
client.Close();
}
|
|
|
|
|
Try creating a TcpListener , listening at a local endpoint and accepting tcp connections
TcpListener listener = new TcpListener(YOUR EndPoint here(new LocalEndPoint(....)));
listener.Start();
Listener.AcceptTcpConnections...
//Wait for new Connection from Client
Then at the Client Side you should simply create a TcpClient and connect To a RemoteEndPoint which is what u've created as localEndpoint at your server side,
TcpClient tcpc = new TcpClient(remoteEndPoint);
then you can send objects to server and obtain responses
try http://www.google.com/search?hl=en&source=hp&q=simple+Client+Server+C%23&aq=f&oq=&aqi=
|
|
|
|
|
Want Remote Connection in Sql Server with C# application ... via Sql Server Authentication... Data Souurce name was created Successfully ... But Could not Access that DataSource name from our C# appliction...Wht is Trusted in Sql Server ....
Thanks
|
|
|
|