|
C# does not support pointer arithmetic. use unsafe keyword.
unsafe class test
{
int Number;
test *[] Ptr;
}
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Ok, My appologies if this is in the wrong section. I couldnt tell if it was a problem with sql server, or my code.
Im building a small app that grabs some data out of my sql server express 2005 database, and tosses it into a dropdown list. Simple enough.
I decided to go with a WPF gui, so I could drop it onto my web server and view it via IE.
My app works great on every box I try it on, on the local network (after getting all the certificate validation done). However, when I try to access it from a computer from outside the network, it runs into a bunch of sql server exceptions. My web server and sql server are running on the same machine.
I dont know if its the connection string failing from an outside network, or maybe I just dont understand how its trying to access the sql server. Here is the connection string I use to establish the connection.
SqlConnection con = new SqlConnection(string.Format(@"Data Source=MyComputerName\SQLEXPRESS;Initial Catalog=MYDB;User Id=me;Password=mypw;"));
When I connect to my .xbap file on the webserver from outside the network, I get 'An error occurred in the application you were using' and the following error in the 'More Information'
--The Error is quite verbose, so i tried to only include a portion of it--
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
If more information would be useful, let me know.
|
|
|
|
|
josephchild wrote: and that SQL Server is configured to allow remote connections.
By default, SQL Express will refuse any connections that are made to the database that originate from outside of that computer. That setting can be changed, off course. Read about it here[^].
I are troll
|
|
|
|
|
the article you mention says:
Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
** In the sql server 2005 Surface area configuration: I have my settings set to 'Local and remote connections' with 'Using both TCP/IP and named pipes'
Turn on the SQL Server Browser service.
** In the sql server 2005 Surface area configuration: I have the SQL Browser service running, and startup type set to Automatic
Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.
** I have no firewall enabled. I even made sure port 1433 is being forwarded to my server. I also tried setting the computer up as the DMZ.
Do you have any more suggestions? I really appreciate your help in this.
I am able to connect and run my app from other computers on my network. I just am unable to connect and run the app from outside the network.
|
|
|
|
|
Sounds like your settings are correct and that there's something on your network that's preventing the connection. Have you tried from a different network? At that point I usually try to find a good network-admin to help me
I are troll
|
|
|
|
|
unforturnately I dont think I'll be able to try from another network. I cant think of anything preventing the connection. My web server Im using is Apache/2.0.55 win32 .. I cant think of any reason it would be apache keeping this from working. From what I understand, it seems that the app is having a problem hitting the sql server, and that I might have some setting wrong. If you or anyone else has any ideas, I would be happy to hear them.
|
|
|
|
|
I want multiple equation in any Textbox like plus ,minus , multiply, Subdivision
Example: 4+9-5*12/3=32, How it possible ?
|
|
|
|
|
You need an Eval-function.
Have a look at this article:
C# Eval Function[^]
You can also write an eval function on your own, this will include parsing, buildung a syntax tree etc.
Regards
Sebastian
|
|
|
|
|
you mean that you need to generate the result of your equation in your text box after you type "=" sign???
Have a Happy Coding.....
|
|
|
|
|
I add different controls like RadioButtons, CheckBoxes, text boxes, labels, in the controls collection of a windows form at run time to render different Question and their options to generate a Questionare. now i want to read these controls one by one to store data from selected controls(radiobuttons, checkbox). but iam failed to do so.
PLZ help me how i read these controls at run tome, in windows application.
|
|
|
|
|
when you create and add the controls to the form you should be giving them a name...
TextBox1.Name = "TextBoxQuestion1";
then you can access if with...
Form1.Controls["TextBoxQuestion1"].Text;
or...
TextBox tbq1 = (TextBox)Form1.Controls["TextBoxQuestion1"];
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
How can i create a folder in ftp from windows application?
Thankyou
YPKI
|
|
|
|
|
|
Hi
I would like to save System.Windows.Control.Image to a .bmp file.Any solutions please?
Thanks in advance
Bharti
|
|
|
|
|
You can't. You'd need a Bitmap for that ( which you can use as an Image, it's derived from the Image class ), then you can use the Save method.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Cristian,
I agree with you that we need a bitmap, , but to that I need System.Drawing.Image to pass to the constructor, and not System.Windows.Control.Image .
I was not able to typecast as well. Any suggestions pls.
Thanks
Bharti
|
|
|
|
|
obj is type of "System.Windows.Controls.Image"
System.Windows.Controls.Image myImage = ((Image)obj);
System.Windows.Media.Imaging.BitmapImage bitmapImage = new System.Windows.Media.Imaging.BitmapImage();
bitmapImage = ((System.Windows.Media.Imaging.BitmapImage)myImage.Source);
System.Windows.Media.Imaging.PngBitmapEncoder pngBitmapEncoder = new System.Windows.Media.Imaging.PngBitmapEncoder.PngBitmapEncoder();
System.IO.FileStream stream = new System.IO.FileStream(@"C:\newImage.png", FileMode.Create);
pngBitmapEncoder.Interlace = PngInterlaceOption.On;
pngBitmapEncoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(bitmapImage));
pngBitmapEncoder.Save(stream);
stream.Flush();
stream.Close();
Have fun
|
|
|
|
|
Hi,
I am using String Array i split one and i got the result but now i am trying to split it again for more requirements as i spited again i got two line only, I need every single word,
Now tell me please what should i do for that once i spited it and got my result but second time it is displaying only two lines not every single word.
|
|
|
|
|
can u b a little more specific, wat is that u require,Is that u need all the words from a string
Eg:if string is "India is my country", u need result in an array with values {India,is,my,country}.
Is this ur need
|
|
|
|
|
Yes, but I am trying to make it more specific
Suppose I have data of A to Z letters which i split it and got one letter like S from A to Z....
Now as i got S then I did split it again and i got two line only which is S on 0 line and remaining are on line 1.
Now i want to split only line which contains all letters without S.
I think this description will make it easy to understand.
This is what i am trying to do if you are get my points then do replay please...
|
|
|
|
|
Sajjad Leo wrote: I think this description will make it easy to understand.
Hmm, not really. Could you provide a sample?
|
|
|
|
|
I have one mother arraylist which contains no. of arraylist whose count is dynamic.
All childArrayList contains string values. I have to get all unique combinations for all the values in all arraylist.
If motherArrayList contains 4 arraylist, then length of combination string should be 4.
modified on Wednesday, April 1, 2009 2:59 AM
|
|
|
|
|
Use a random number generator to generate positions out of the number of elements remaining, and hten each time, pull out that one value and put it in your new, random list.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hello Friends and Programmers,
thanx for taking interest in my question. Actually, I want to edit the Windows Registry using C# Console application. But, I know that I have to take the System namespace as System.Win32, but what is the other piece of code. I am likely to change the ValueData from default 400 to 100 of MenuShowDelay under the following registry path : HKEY_CURRENT_USER/Control Panel/Desktop/MenuShowDelay. This edit will speed up the up the Listing of menu in the System. Please help me!
Hope to hear from u guys soon,
Rajdeep.NET
|
|
|
|
|
Registry.CurrentUser.CreateSubKey("Control Panel\\Desktop\\MenuShowDelay").SetValue("Value1", "Value2");
Enjoy.
var question = (_2b || !(_2b));
|
|
|
|