Click here to Skip to main content
15,907,231 members
Home / Discussions / C#
   

C#

 
GeneralRe: FileStream question... again Pin
RussBus26-Jun-07 5:27
RussBus26-Jun-07 5:27 
GeneralRe: FileStream question... again Pin
Colin Angus Mackay26-Jun-07 5:30
Colin Angus Mackay26-Jun-07 5:30 
GeneralRe: FileStream question... again Pin
Dave Kreskowiak26-Jun-07 6:58
mveDave Kreskowiak26-Jun-07 6:58 
AnswerRe: FileStream question... again Pin
Luc Pattyn26-Jun-07 5:41
sitebuilderLuc Pattyn26-Jun-07 5:41 
GeneralRe: FileStream question... again Pin
RussBus26-Jun-07 5:48
RussBus26-Jun-07 5:48 
GeneralRe: FileStream question... again Pin
Luc Pattyn26-Jun-07 6:00
sitebuilderLuc Pattyn26-Jun-07 6:00 
GeneralRe: FileStream question... again Pin
RussBus26-Jun-07 6:39
RussBus26-Jun-07 6:39 
QuestionSocket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
haroon198026-Jun-07 4:37
haroon198026-Jun-07 4:37 
I am doing .Net Remoting and i get following exception what can be the reason?Confused | :confused:

1. Interface
<br />
public interface DeptInterface<br />
{<br />
bool ExecuteSelectCommand(string selcommand);<br />
string GetRow();<br />
void Init();<br />
}<br />
<br />
2. Server.cs // which implements ClassLibrary Methods<br />
<code><br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
public class CustServer : MarshalByRefObject, DeptInterface<br />
{<br />
private SqlConnection myConnection = null;<br />
private SqlDataReader myReader;<br />
<br />
public CustServer() { }<br />
<br />
public void Init()<br />
{<br />
try<br />
{<br />
String strConn = "Data Source=KPTEST1;Initial Catalog=Store;Integrated Security=SSPI";<br />
myConnection = new SqlConnection(strConn);<br />
myConnection.Open();<br />
if (myConnection == null)<br />
{<br />
MessageBox.Show("OPEN NULL VALUE =====================");<br />
return;<br />
}<br />
}<br />
catch (Exception es)<br />
{<br />
MessageBox.Show("[Error WITH DB CONNECT...] " + es.Message);<br />
}<br />
}<br />
public bool ExecuteSelectCommand(String selCommand)<br />
{<br />
try<br />
{<br />
MessageBox.Show("EXECUTING .. " + selCommand);<br />
SqlCommand myCommand = new SqlCommand(selCommand);<br />
if (myConnection == null)<br />
{<br />
MessageBox.Show("NULL VALUE =====================");<br />
return false;<br />
}<br />
myCommand.Connection = myConnection;<br />
myCommand.ExecuteNonQuery();<br />
myReader = myCommand.ExecuteReader();<br />
return true;<br />
}<br />
public string GetRow()<br />
{<br />
if (!myReader.Read())<br />
{<br />
myReader.Close();<br />
return "";<br />
}<br />
int nCol = myReader.FieldCount;<br />
string outstr = "";<br />
object[] values = new Object[nCol];<br />
myReader.GetValues(values);<br />
for (int i = 0; i < values.Length; i++)<br />
{<br />
string coldata = values[i].ToString();<br />
coldata = coldata.TrimEnd();<br />
outstr += coldata + ",";<br />
}<br />
return outstr;<br />
}<br />


Client.cs
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("TEST1");<br />
bool ensureSecurity = true;<br />
ChannelServices.RegisterChannel(new TcpClientChannel(), ensureSecurity);<br />
dept = (DeptInterface)Activator.GetObject(typeof(DeptInterface), "tcp://KPTEST1:8080/CustServer");<br />
if (dept == null)<br />
{<br />
MessageBox.Show("TCP SERVER OFFLINE ...PLEASE TRY LATER");<br />
return;<br />
}<br />
dept.Init(); // Exception Error<br />
MessageBox.Show("TEST2");<br />
}<br />

It gives exception at dept.Init() ? What can be the reason please help me... Frown | :(
AnswerRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
Ed.Poore26-Jun-07 5:06
Ed.Poore26-Jun-07 5:06 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
haroon198026-Jun-07 5:10
haroon198026-Jun-07 5:10 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
Ed.Poore26-Jun-07 5:55
Ed.Poore26-Jun-07 5:55 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
haroon198026-Jun-07 5:59
haroon198026-Jun-07 5:59 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
Ed.Poore26-Jun-07 6:41
Ed.Poore26-Jun-07 6:41 
AnswerRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
led mike26-Jun-07 5:29
led mike26-Jun-07 5:29 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
haroon198026-Jun-07 5:36
haroon198026-Jun-07 5:36 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
led mike26-Jun-07 5:52
led mike26-Jun-07 5:52 
GeneralRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
haroon198026-Jun-07 5:54
haroon198026-Jun-07 5:54 
AnswerRe: Socket Exception:{"An existing connection was forcibly closed by the remote host"} Pin
LongRange.Shooter26-Jun-07 9:52
LongRange.Shooter26-Jun-07 9:52 
GeneralRe: How to implement a syntax checker using C# ? Pin
I.explore.code26-Jun-07 3:58
I.explore.code26-Jun-07 3:58 
Questionmy previous button is working as a next button Pin
srinivassam26-Jun-07 3:50
srinivassam26-Jun-07 3:50 
AnswerRe: my previous button is working as a next button Pin
Luc Pattyn26-Jun-07 4:24
sitebuilderLuc Pattyn26-Jun-07 4:24 
QuestionExists() method of System.Collections.Generic.List Pin
lossy26-Jun-07 3:28
lossy26-Jun-07 3:28 
AnswerRe: Exists() method of System.Collections.Generic.List Pin
Giorgi Dalakishvili26-Jun-07 3:38
mentorGiorgi Dalakishvili26-Jun-07 3:38 
GeneralRe: Exists() method of System.Collections.Generic.List Pin
lossy26-Jun-07 3:48
lossy26-Jun-07 3:48 
AnswerRe: Exists() method of System.Collections.Generic.List Pin
Colin Angus Mackay26-Jun-07 3:41
Colin Angus Mackay26-Jun-07 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.