|
OH lol
it does work
I forgot to add the width of the previous button..
stupid me.
Thanks
okay, now that this works.
I need to make the buttons clickable and change the contents of a textbox.
How is this done?
modified on Tuesday, June 17, 2008 1:13 PM
|
|
|
|
|
Hi,
How do I get a list of sql server 2005 machines from the network please?
Thanks
|
|
|
|
|
EnumAvailableSqlServers () will retrieve all SQL 2005 instances.
|
|
|
|
|
Please try this:
DataTable dtSQLServers = SmoApplication.EnumAvailableSqlServers(false);
foreach (DataRow drServer in dtSQLServers.Rows)
{
String ServerName;
ServerName = drServer["Server"].ToString();
if (drServer["Instance"] != null &&
drServer["Instance"].ToString().Length > 0)
ServerName += @"\" + drServer["Instance"].ToString();
if (comboBoxServer.Items.IndexOf(ServerName) < 0)
comboBoxServer.Items.Add(ServerName);
}
Find URL for more references:
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.smoapplication.enumavailablesqlservers.aspx[^]
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
Hello,
i have a class which needs to write some measurement data to a memory stream. The measurement data can be of multiple (value) types, e.g. float, int, short, etc.
Therefore i wanted my class to be generic.
public void save(T[] data)
{
for (int i = 0; i < data.Length; ++i) ms_.Write(data[0]);
}
whereas ms_ is the aforementioned MemoryStream. This gives me a compiler error and i have no idea how to solve it. Adding where T : struct to the class declaration doesn't help.
Ideas anyone?
Cheers
Jan
|
|
|
|
|
Not to do with your current question, but when you read back the data how do you know if it's an int or a float? Or any other type?
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
The MemoryStream is actually just a buffer which is used to serialize the data to a file. The file has a header so i can derive the data types from there.
Besides, i solved the problem by using Convert.ToByte(data[i]) . Seems to work fine
Cheers
Jan
|
|
|
|
|
It would be nice to see the compiler error, although I suspect it complains about having no overloaded version of write that takes your type.
Try to use a StreamWriter. Like in the following:
public void save(T[] data)
{
StreamWriter sw = new StreamWriter(ms_);
for (int i = 0; i < data.Length; ++i) sw.Write(data[i]);
}
Even better, since there is no guarantee that T is one of the types for which StreamWriter.Write has an overload, you could do this instead:
public void save(T[] data)
{
StreamWriter sw = new StreamWriter(ms_);
for (int i = 0; i < data.Length; ++i) sw.Write(data[i].ToString());
}
|
|
|
|
|
Hi,
How can I access a database from the server when installing my application on the client PC.
thanks
|
|
|
|
|
Can you mention here which Database you are using ?
By the way: You can access via the
(1) Remote Server IP
(2) Valid User Name/Password
(3) Database Name
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
I will use SQL2005 database
|
|
|
|
|
I think Vista might be the culprit....
Anyway, could anyone share with me how to send some data over UDP and recieve it?
Now it's not working, and I have no clue if it's the sending or recieving or both which fails....
Anyway I have simple code like that:
public void Send(byte[] data, IPEndPoint to)<br />
{<br />
using (Socket sock = new Socket(to.AddressFamily, SocketType.Dgram, ProtocolType.Udp))<br />
sock.SendTo(data, SocketFlags.None, to);<br />
}<br />
<br />
<br />
public void Receiving()<br />
{<br />
byte[] rbuf = new byte[1 << 14];<br />
using (Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp))<br />
{<br />
sock.Bind(new IPEndPoint(IPAddress.Any, aPort));<br />
while (true)<br />
{<br />
EndPoint rep = new IPEndPoint(IPAddress.Any, 0);<br />
int read = sock.ReceiveFrom(rbuf, ref rep);<br />
Recieved(rbuf, read, rep);<br />
}<br />
}<br />
}<br />
void Recieved(byte[] buf, int nRead, EndPoint where)<br />
{<br />
Console.WriteLine("Recieved {0} byte(s) from {1}", nRead, where);<br />
}
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
modified on Tuesday, June 17, 2008 10:58 AM
|
|
|
|
|
Can you post here Error message which you are getting ?
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
Thanks for replying!
Anyway I figured it out (see my other post).
In answer to your question, however, it didn't thrown any error at all!
That is, until I thought of trying to run the server as an Administrator.
Then I got a SocketException which told me to use sock.Bind() first.
As to why it fails silently when I run as a normal user, it's a mystery...
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Never mind,I found it!
I should also (in the listenin code)
sock.Bind(new IPEndPoint(IPAddress.Any, aPort))
Pay attention to 'aPort' I should use the same port for target IPEndPoint when sending data
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi,
Has any one worked with the entity framework? Is it worth while using? I am looking for a solution for code generation, I have tried out Codesmith Tools but the support lacks.
Can I please hear comments on the entity framework. Where can I currently get it for download? I know that the full solution is available in SP1 for Visual Studio. I wonder when this will be released?
Thanks
Brendan
|
|
|
|
|
I believe it's being released this summer as part of .NET 3.5 Service Pack 1.
Life, family, faith: Give me a visit.
From my latest post: "A lot of Christians struggle, perhaps at a subconscious level, about the phrase "God of Israel". After all, Israel's God is the God of Judaism, is He not? And the God of Christianity is not the God of Judaism, right?"
Judah Himango
|
|
|
|
|
When is summer?? It's helps me not, I stay in South Africa.
|
|
|
|
|
Summer is just starting here in the US. It will probably be released within 1-2 months. If you want to try out these bits, there's a public beta for the Entity Framework out there.
Life, family, faith: Give me a visit.
From my latest post: "A lot of Christians struggle, perhaps at a subconscious level, about the phrase "God of Israel". After all, Israel's God is the God of Judaism, is He not? And the God of Christianity is not the God of Judaism, right?"
Judah Himango
|
|
|
|
|
Have you worked with it before, or played around enough with the entity framework? Is it good? How is the design? Is it like an ORM?
|
|
|
|
|
Hi, I am trying to read in a attribute that I have added to some fields (not all my fields have this attribute). That is what I want to base my loop through all the controls on a page with.
Custom attribute is: PDFField
ex: <asp:textbox id="txt_Custom1" runat="server" pdffield="txtCustNo" xmlns:asp="#unknown">
now each page can have mutiple or zero "custom" textboxes or any other input types.
so far I cant seem to find a way to access each control to find if they have the PDFField attribute. Does anyone know how to do this?
Thanks,
Zach Bob
|
|
|
|
|
Hi,
Isn't is just to read it using
if(txt_Custom1.Attributes["pdffield"] != null) { do anything with it.... }
I guess you know how to sweep through all controls in the form.
Hope this helps.
Those who want most to speak up, are often those who have nothing clever to say.
modified on Friday, June 20, 2008 3:33 AM
|
|
|
|
|
|
You asked this in the C# and VB.NET forums. your code is VB. Please don't cross post.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Could not get any help from there?
r00d0034@yahoo.com
|
|
|
|