The Wayback Machine - https://web.archive.org/web/20090210053216/http://www.codeproject.com:80/script/Forums/View.aspx?fid=1649
Click here to Skip to main content
5,875,043 members and growing! (18,758 online)
Announcements
* Bold indicates new messages since 19:32 9 Feb '09




BullFrog Power
Advanced Search
Sitemap

C#


Home > Forums > C#

 Msgs 1 to 25 of 12,544 (Total in Forum: 239,339) (Refresh)FirstPrevNext
AdminHow to get an answer to your questionadminChris Maunder17:31 10 Nov '05  
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
  5. If you are posting source code with your question, place it inside <pre></pre> tags, or click the "Ignore HTML tags in this message" check box.
  6. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
  7. Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
  8. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
  9. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
  10. No advertising or soliciting.
  11. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.

cheers,
Chris Maunder
CodeProject.com : C++ MVP

QuestionVideoSharingAcross LANmembersreeraj.a.1719mins ago 
I am new to C#.net...
I wanted to know the idea of sharing the video across local area network
QuestionPlacing coordinates on jpg filemembertauras8127mins ago 
Hi,

I am using the Sharpmap to plot points on the shape file and jpeg file.
I was able to plot points on the shape file.But while using the jpeg file I was not able to correctly place the coordinates the image gets small and coordinates are placed outside.Please tell how to place coordinates on jpeg file. I had included raster layer though
QuestionMerging DataTable Manualymemberindiaone57mins ago 
Hi,
I am getting more than one Table from different DataBase and manualy marging into one table.
this procedure taking more time.so i need to improve performance.
if i use DataTable.Merge method it's merging.it's add new row in same table.

can one help me

Thanks
AnswerRe: Merging DataTable ManualymemberPIEBALDconsult30mins ago 
Why are you merging them? What is the eventual goal?
QuestionHow to replace the value of Img src [modified]memberaldo hexosa1 hr 11mins ago 
I want to replace the value of src attribute of html source code.
for example the html source code is
<img src="C:\script\link.png">
<img src="C:\script2\link.png">
<img src="C:\script3\link.png">
and i want to replace the folder path ("script" or anything) to C:\myfolder\
How to replace this
Thanks in advance

modified on Monday, February 9, 2009 11:33 PM
QuestionMultiple Timersmemberpush19881 hr 37mins ago 
Hello everyone, I am a beginner at C#. My problem is as follows:
1. I am coding a server app running on a single proxy server.
2. We have got a client app on each client machine which pings the server (using UDP)
3. For the first ping, server app creates a new entry in the existing linked list (using IPAdress)
4. For each such entry, it starts a timer (should run for 60 sec.)
5. If any client app pings again within 60 secs, its timer should be reset. Timer Code should be non blocking.
6. If timer expires, corrosponding IPAddress Node should be removed from Linked List.

How do I implement this specific timer functionality? I will have to start 100 timers for 100 clients! And that too, each timer should have its own identity... IPAdress! OMG

Please help. Waiting anxiously for reply.
Thank you.
Sniff
AnswerRe: Multiple TimersmemberPIEBALDconsult1 hr 19mins ago 
I wouldn't. I would prefer a database, but a Dictionary would work too.

On each ping, I'd update the database or Dictionary for the pinger with the current time. Then periodically, enumerate the list, removing any entries where the time is expired.
QuestionRe: Multiple Timersmemberpush19881 hr 11mins ago 
But if I use a dictionary/database, how do I decrement the timer for each entry after each second? Since, in general, the number of entries may be large, how do I ensure that the decrement of the first entry and the last entry takes place within that same second? :(
AnswerRe: Multiple TimersmemberPIEBALDconsult32mins ago 
You don't, you simply compare the time of the last ping with the current time and remove any entries that are older than some threshold.
QuestionRepository pattern and LINQ [modified]memberminus_one1 hr 47mins ago 
I am relatively new to design patterns and LINQ to SQL and have come across a bit of a bump, mainly due to a lack of understanding on my part.

The situation i have setup at the moment is i am using DDD and so have my Domain/Model layer with all my domain objects contained therein, and my Infrastructure layer where i am trying to implement the Respoitory pattern. In my database i have tables such as BATCH, SITE and COMPANY, with BATCH having columns such as SiteID and OwnerID which are GUID types related to the ID's columns of the SITE and COMPANY tables respectively.

I have:


public interface IRepository < t >
{
IList < t > GetAll();
T FindBy(object key);
void Add(T item);
void Remove(T item);
}

public class BatchRepository : IRepository
{
...
}


What would be the best way to go about pulling a more rich set of information than just the Batch object with only GUID data?

Previously, i would of used a SQL query that used JOIN to get the Company.CompanyName using Batch.OwnerId etc...

But now, the Repository returns only the plain BATCH object from the database, and obviously then iterating through each of these Batch objects and querying the DB AGAIN for the OwnerName, SiteName etc based on the Batch.OwnerId , Batch.SiteId data is wasteful...

Should i be creating additional domain layer objects such as BatchResult that has a more rich set of data properties and making the repository return that type instead?

Thanks in advance for patience with my ignorance Wink

modified on Monday, February 9, 2009 10:51 PM

QuestionDataTable Update Access databasememberPlanker2hrs 6mins ago 
I am reading a table in from one access Database and storing it in a DataTable(or DataSet if easier)
I then want to update an empty table in another database with the data in the DataTable.

the two tables have the same fields

I know I can read the DataTable row by row and add the data to the 2nd database but I am wondering if there is an easier shorter way.

here is the code I am currently working on, (not sure that it will work all of the DataTable/DataSet examples I have found only are working with pulling data and updating from a single database.

DataTable HashTable = new DataTable();
Classes.SeedsDB seed = new Classes.SeedsDB();
seed.GetHashTable(ref seedDBPath, ref HashTable); //Opens 1st Database and stores the Table in HashTable
OleDbDataAdapter Adapter = new OleDbDataAdapter("SELECT * FROM BadHashTable",MAconn);
OpenAccessDB(); //Opens 2nd Database holds connection string that works in other Methods in the class
OleDbCommandBuilder Cmdbld = new OleDbCommandBuilder(OSAppsAdapter);
Adapter.Update(HashTable);
CloseAccessDB();
AnswerRe: DataTable Update Access database [modified]memberPIEBALDconsult1 hr 29mins ago 
I prefer to just use a DataReader to read from one and copy to another.

Simply using the Update won't work, as you've found. The rows have the wrong status for that, you'd have to change their status. It's kind of the opposite of AcceptChanges. I'm not sure you can, I haven't tried it. I'll have a quick look.

[Later] See

DataRow.SetAdded Method

Changes the Rowstate() of a DataRow to Added.

modified on Monday, February 9, 2009 11:45 PM

Question.net Remoting with multiple nics on client sidememberobadran2hrs 27mins ago 
I'm working on a system that has two servers. Server A is the remoting client to server B which is the remoting server. Server A has two nics where nic A is on one network (ie 198.168.x.x) and nic B is on another network (ie 10.x.x.x). Server A is connected to Server B on the 10.x.x.x network.

The problem we are having is that Server A has a hard time establishing a connection with the remoting server. It seems that the client can't figure out which network card to use. When we disable the nic on the 198.168.x.x network, we have no problems establishing a connection to the remoting server.

I've read articles about setting the "bind to" attribute but this seems to be only for the remoting server.

Does anyone have any suggestions?

Thanks,
Omar
QuestionUsing a System.Windows.Forms.WebBrowser inside ASP web formmembertrinm19873hrs 41mins ago 
I need to use a WebBrowser in ASP.NET.Vui to show me!
AnswerRe: Using a System.Windows.Forms.WebBrowser inside ASP web formmvpN a v a n e e t h3hrs 37mins ago 
This[^] will help you.


GeneralRe: Using a System.Windows.Forms.WebBrowser inside ASP web formmembertrinm19873hrs 24mins ago 
You know the only help me, why me again review the question of me.You do not understand the content I will describe the requirements more clearly
GeneralRe: Using a System.Windows.Forms.WebBrowser inside ASP web formmvpN a v a n e e t h3hrs 17mins ago 
Yes please. Your question is not clear.


GeneralRe: Using a System.Windows.Forms.WebBrowser inside ASP web formmemberABitSmart1 hr 10mins ago 
nice one Big Grin
AnswerRe: Using a System.Windows.Forms.WebBrowser inside ASP web formmemberPIEBALDconsult1 hr 17mins ago 
I thought it was the other way around.
QuestionReplacement for VSAmemberAaron Stubbendieck4hrs 18mins ago 
Since Visual Studio for Applications is now considered obsolete, what replacements are people now using for adding scripting to their application?? I'm not interested in VSTA due to the licensing fees and I wonder if there is anything out there that is better than CodeDOM? I'm looking for a scripting language that very similar to C or Basic in syntax.

If it matters, my application is .NET 2.0


I'd appreciate any insights, thanks.
Questiontokenize stringmemberlawrenceinba4hrs 38mins ago 
 string strInput= "plotno 55,xx street,yy city";
char[] delimiters = { ',', '#', ';', ' ', '/', '\0', '&', '-' };
string[] strTemp = strInput.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
foreach (string a in strTemp)
{

Console.WriteLine(" token'd string is\t{0}\t", a);


the ouput of the above code is

token'd string is plotno
token'd string is 55
token'd string is xx
token'd string is street
token'd string is yy
token'd string is city

it doesnt takes the specified delimiters as a token..... how to tokenenize icluding delimiters...

thanks

the quieter u become more u hear

AnswerRe: tokenize stringmemberPIEBALDconsult3hrs 39mins ago 
Use a Regular Expression instead.
GeneralRe: tokenize stringmemberlawrenceinba3hrs 13mins ago 
but input will be from array list...

is it possible to pass array list as input to regex

the quieter u become more u hear

GeneralRe: tokenize stringmemberABitSmart2hrs 19mins ago 
Have you tried Regex.Split ?

With the input pattern like "(,)|(#)|(Wink|( )|(/)|(&Wink|(-)"

string pattern = "(,)|(#)|(Wink|( )|(/)|(&Wink|(-)";
string[] splitOutput = Regex.Split(input, pattern);

(the option for ; in the pattern is replaced by the smiley in the post Smile )

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Last Updated 9 Aug 2007
Web15 | Advertise | Privacy
Copyright © CodeProject, 1999-2009
All Rights Reserved. Terms of Use