|
Hi,
I m working on DNet Remoting to develop trading application to accept bid/ask value from user and broadcast to every connected user.
Process is working smoothly on localhost as well as on LAN.
But it is not working when i host app on static IP based server.Client send bid/ask value to server but does not get updates except client running on server.
Currently i m running server app manually by clicking on server.exe.
I did not get any change if I replace http channel with tcp
Any comment/suggestions r invited. Thanks all.
Client and Server Configuration file are given below.
Server Config File
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="Trading">
<service>
<wellknown mode="Singleton" type="Server.Broadcaster, Server" objectUri="Broadcaster.soap"/>
</service>
<channels>
<channel ref="http" port="16784">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
Client Config file
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="EventClient.exe">
<client>
<wellknown type="Common.IBroadcaster, Common" url="http://203.200.95.133:16784/Trading/Broadcaster.soap"/>
</client>
<channels>
<channel ref="http" port="0">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
|
|
|
|
|
Make sure port 16784 isn't blocked by your firewall.
|
|
|
|
|
Hi Guys. Maybe somebody here can help me. I'm writing a little app that writes records from a text file to an Excel file. However, I am writing data to two columns, namely A2 and B2. Problem here is that Every record gets appended to the same cell A2 and B2 instead of going onto writing the next record to A3 and B3 etc. Any ideas what I'm doing wrong here?
Code below:
foreach (ReadFile nomread in res)
{
objRange = objSheet.get_Range("A2", System.Reflection.Missing.Value);
objRange.Value2 += nomread.CLIENTSURNAME;
objRange = objSheet.get_Range("B2", System.Reflection.Missing.Value);
objRange.Value2 += nomread.CLIENTFORENAMES;
}
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Kwagga wrote: objRange = objSheet.get_Range("A2", System.Reflection.Missing.Value);
Kwagga wrote: objRange = objSheet.get_Range("B2", System.Reflection.Missing.Value);
This is what you're doing wrong. You are selecting same cell in loop, so you will get different value from nomread but it will write in same cell.
There are two ways you can write values to excel cell. One is using two dimensional array which would look something like yourArray[2,2] and you would send that to your excel worksheet. But in your code it seems like you don't know the max number or cells you will need. So for something like this you can use Array and Column index to write array.
The code will looks something like this:-
int iR, iC;
iR = 1;
iC = 1;
foreach (ReadFile nomread in res)
{
objSheet.Cells[iR, iC] = nomread.CLIENTSURNAME;
objSheet.Cells[iR, iC+1] = nomread.CLIENTFORENAMES;
iC = 1;
iR++;
}
I haven't tested this code so you may need to make some changes. But the point is you should get an idea from this...
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Thanks mate. It doesn't write all the records though. Only writes the last record. I get the jist of it and will see what I can do with what you provided me.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Kwagga wrote: It doesn't write all the records though. Only writes the last record. I get the jist of it
What do you mean by it doesn't write all the records?? Can you post the code that you're using now??!
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hi Mate. It works fine. I missed something from your sample.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Okay
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Mate, what if I have more than just the two columns??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
It depends on your set of data. For example if I had 1000 random numbers in collection I would just increment iC column index. And when the column index hits 50 I would increment iR (row Index) and set iC (column Index) back to 1.
This is the code I used before for one my college projects. BUT KEEP IN MIND THAT IT HAS RANDOM NUMBERS ONLY. AND ORDER DOES NOT MATTERS IN THIS.
int iR, iC;
iR = 1;
iC = 0;
for (int i = 0; i <= Globals.Vars.arVbNums.Count - 1; i++)
{
iC++;
if (i % 30 == 0 && i != 0)
{
iR++;
iC = 1;
}
oSheet.Cells[iR, iC] = Globals.Vars.arVbNums[i];
}
But if you're dealing with something like, Data base where order of values matters you will have to stick to + operator. If you look at the code I gave you before it has something like [iR, iC+1] so you will just write something like [iR, iC+2] for next column.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hi
I m developing an application in C#. I m recording a video from Webcam and saving it on harddisk. it creates .avi file, which is very heavy file. so I want to convert it into .mpeg or any other format in which my video file is not as much heavy as .avi.
so plz tell me the solution or code for conversion.
Regardz
Shanzay
|
|
|
|
|
If you're looking for a full solution, and don't actually have a programming issue - gotta have actual code to have a programming issue right? - then you're far better off looking for bulk code on sourceforge.[^] You will probably have far better luck. Good luck.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
Hi all.
I know i know first google then searching the forum and then ask stupid questions here we go:
I have a c# project which i can compile and run under Win2k. Now or company finally get XP ( yes )
Now i got a second machine were i should test my systems. Now i can compile this application under XP but when i want to run the app
...this application has failed to start because the application configuration is incorrect...
error appears. I searched through the manifest and found nothing unusual.
[edit] I also went trough the app with the dependcy walker found the DWMAPI.DLL which could not be found any suggestions about that?
if you have any idea or article or any other clue please let me know
thanks
Mathias
modified on Friday, May 30, 2008 8:06 AM
|
|
|
|
|
hi
i want to report from my data with following code :
string htmText = System.IO.File.ReadAllText("Report\\report.htm");
htmText = htmText.Replace("[name]", this.txtName.Text);
htmText = htmText.Replace("[family]", this.txtFamily.Text);
htmText = htmText.Replace("[id]", this.txtStudentNo.Text);
this.webBrowser1.DocumentText = htmText;
this.webBrowser1.ShowPrintPreviewDialog();
it works good, but, at runTime, the printPreviewDialog has a button named 'HeaderFooter' that show header and footer info, is there any way to access HeaderFooter's text and change it by code ?
thanks
|
|
|
|
|
Hello,
I have a strange problem using typed datasets.
I have the following datatable in a typed dataset
ChainDetail
-----------
ChainID
Code
Description
I've populated an instance of the datatable with 2 rows loaded from SQL server.
Here's my problem...
When I either use DataTable.Select or create a DataView and apply a filter to retrieve one row, the select/filter work fine however the datarow returned has FOUR columns.
[0] contains ChainID
[1] contains Code
[2] contains {}
[3] contains Description
This means that I can't cast this to a ChainDetailDataRow, as column [2] should be Description.
Any help or suggestions will be much appreciated!
Thanks
A Very Confused Blakey404
|
|
|
|
|
Hi, how many columns are returned from the query that populates the datatable? if you're using 'SELECT * FROM...' change it to 'SELECT ChainID, Code, Description FROM...'
Perhaps you could post some of the code if this hasn't helped
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
This is the strangest thing...
That is exacly what my query looks like, its in a stored procedure.
When i populate the datatable the three columns are there and correct...
its only when i create a dataview or use .Select that the extra colum is inserted into my results!!
i'm at home now but i will connect to work later on and give a code example...
cheers for the reply
|
|
|
|
|
I've just had a brainwave...
This datatable is populating a combobox, directly via databinding (datasource, datavalue etc)
To clear the combo box i am setting it's index to -1...
could this or something else related to the combobox be inserting my extra column?
i bet it is. crap that's going to be fun to find.
|
|
|
|
|
The databinding shouldn't be the problem here as that's very much a read-only action... then again, I've had all sorts of problems with the comboBox and datasource properties! Try removing the selection using .SelectedItem = null instead. Can you step through the code and find the point where the extra column is added?
Good luck! Rob
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
Here's one for anyone to look out for in the future (i feel like an idiot)
the Description Column should really have been the "Name" column
therefore when i loaded the results into the dataset the name column was blank and the description colum was created
thanks for your help!
A very tired but enlightened Blakey404
|
|
|
|
|
Hi,
I have a Word table, I' ve read the values from this table to data grid. In the last column there is a long text which formatting is changing even within the same cell of table, for example the one part of text is bold, other italic, other underlined, other listed, and particular fragment has NormalStyle, Header 1, Header 2 etc instances of styles.
And my question is: how can I read programatically formatting of text from the single cell (or in general) in that way to be able to recognize the style.
Thank you very much for your help in advance. Each tip will be very helpful
|
|
|
|
|
try
{
// Server SvrNm = new Server();
// SvrNm.ShowDialog();
string line;
StreamReader sr = new StreamReader("Server.ini");
line = sr.ReadLine();
sr.Close();
string connString = "packet size=4096;data source='" + line.Trim() + "';user id='sa';password='';persist security info=False;initial catalog=uhtmch;";
//string connString = "Data Source='"+ line.Trim ()+"';Initial Catalog=uHTMCM;Integrated Security=SSPI;Pooling=False";
//string connString = "server='"+ line.Trim ()+"';database=uHTMCM;uid=sa;pwd=;Integrated Security=true";
conn = new SqlConnection(connString);
conn.Open();
}
Above is the code I wrote to connect to a SQL server database which is on the network(in another pc). The "Server.ini" file has the name of the pc in which the SQL Server ddatabase is running. But every time I run the code It says timeout, The server is not responding. How can I solve this problem?
|
|
|
|
|
try this...
using System.Data.SqlClient;
string ConnString = "User id = sa; Password = yourPassword; Initial Catalog = yourDataBaseName; Data Source = computerName";
SqlConnection sqlConn = new SqlConnection(ConnString);
sqlConn.Open();
SqlCommand cmd = sqlConn.CreateCommand();
cmd.CommandText = "SELECT column FROM table";
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
string someVariable = reader[0].ToString();
}
sqlConn.Close();
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Thank you Harvey.But It's not working. Still same problem.
|
|
|
|
|
im thinking theres a firewall on the PC running the SQL server, i had the same problem before...
you need to either disable the firewall, or enable sql's default port (i think it 1433) so the firewall will let the connection through
hope it helps
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|