889 Posted Topics

Member Avatar for Darth Vader

If you look at your declaration of _list, it is a List of type list2 objects. This means that all objects added to the list must be of type list2 or inherit from type list2. The list1 type inherits from the List<int> type, so it can't be added to the …

Member Avatar for Darth Vader
0
139
Member Avatar for kara1990

Hi kara1990 and welcome to DaniWeb, Can you show us what you have attempted so far and let us know where you are having problems? We will attempt to help you if we know what's wrong but need to see some effort on your part.

Member Avatar for darkagn
0
114
Member Avatar for diya45
Member Avatar for alaa sam

You can use the lock keyword for this. The basic idea is that you lock a private constant object whenever you read or write from the shared variable. Like this: public class MyMultiThread { private const Object lockObject = new Object(); private int sharedVariable; public MyMultiThread() { WriteSharedVariable(0); } public …

Member Avatar for alaa sam
0
193
Member Avatar for Jsplinter

You can use pointer types in C# however they are rarely needed. Check out [msdn's article](http://msdn.microsoft.com/en-us/library/y31yhkeb%28v=vs.80%29.aspx) on pointer types in C#.

Member Avatar for darkagn
0
124
Member Avatar for kubiak

You can obtain the client IP address with the following call: string clientConnection = ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString(); where `tcpClient` is your TCPClient object.

Member Avatar for darkagn
0
174
Member Avatar for Darth Vader

Have you tested the Convert.ToDouble function against the Double.TryParse function? I'm not sure if it's faster, but it is generally the preferred approach as it handles exceptions for you. EDIT: There is also a TryParse static function for each of the other "primitive" types (Int32, Decimal, Byte etc).

Member Avatar for tinstaafl
0
1K
Member Avatar for diya45

Yes you can delete the guest, see MSDN's explanation of a [SQL Delete](http://msdn.microsoft.com/en-us/library/ms189835.aspx) statement. You need to set the parameters for your update function, see the [SqlCommand.CreateParameter](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.createparameter.aspx) function.

Member Avatar for arunkumars
0
218
Member Avatar for Lethugs

Something like the following query should get you close: -- need a count of the objects by description and transaction SELECT Description.Name, COUNT(Item.Name) AS count, COUNT(Transaction.Type) AS [under repair] FROM Description -- describe the relationship between the tables by joining INNER JOIN Item ON Description.DeID = Item.DeID INNER JOIN Transaction …

Member Avatar for darkagn
0
309
Member Avatar for zachattack05

Your method example creates a new instance of the myClass class EACH TIME it is called, and stores the value of the parameters in its own instance variables. This is thread-safe. I'm not sure that ALL static methods are thread-safe though. It is possible to access static global variables that …

Member Avatar for zachattack05
0
215
Member Avatar for Sivapatham

Hi Sivapatham and welcome to DaniWeb, A very simple algorithm for this would be: [code=php] for( $i = 0; $i < $n; $i++ ) // if $n is number of teams { for( $j = $n-1; $j > $i; $j-- ) { // teams for this match have id's = …

Member Avatar for Bomf
0
3K
Member Avatar for Jazerix

So what do you get back instead? You will need to read from the response stream and deserialize the returned JSON into a list using whatever DataContract is being returned to you. Also, you can check the `response.StatusCode` to see whether the response is a successful response (ie `HttpStatusCode.OK`) or …

Member Avatar for darkagn
0
160
Member Avatar for gelmi
Member Avatar for harishbansal90

Looks like an encoding issue. Do you know what encoding the HTTP response is in? Something like this will read the response in UTF8 encoding: using (var reader = new StreamReader(errorResponse.GetResponseStream(), Encoding.UTF8)) { string error = reader.ReadToEnd(); Console.WriteLine(error); }

Member Avatar for JOSheaIV
0
343
Member Avatar for Aia

[QUOTE=masijade;500410]change from show() to setVisible(true) .... and find a better tutorial, that one's outdated.[/QUOTE] Masijade's right here - find a tutorial on swing rather than awt as the swing packages have mostly overtaken the functionality of the awt packages.

Member Avatar for flash901
0
937
Member Avatar for jobojo

Make sure that line 7 (and all lines for that matter) in your csv don't have more than 19 commas. That will give you 20 values in a csv file. This line in a csv file: 1,,2,,3 actually has 5 values, it's just that 2 of the values are null/blank.

Member Avatar for iamthwee
1
188
Member Avatar for tboctavan

You can use a WriteLine() to describe what you want the user to enter, then wait for their response using ReadLine(). You will need to make sure that the user has entered a number.

Member Avatar for nakor77
0
226
Member Avatar for semicolon

`Thread.Abort()` or `Thread.Join()` are the two simplest ways of ceasing a thread from running. What issue do you have with `Thread.Abort()`?

Member Avatar for nmaillet
0
115
Member Avatar for mithila
Member Avatar for umesh sevra
-2
220
Member Avatar for BigHeart

Remove the dbo. from the INSERT query. It thinks you are trying to call your procedure recursively rather than insert directly to the table Transactions. BTW naming is important in a database, and TRANSACTION is a special SQL word. Try using a more descriptive name for the procedure, such as …

Member Avatar for darkagn
0
184
Member Avatar for weajane01

Hi weajane01 and welcome to DaniWeb :) Your deletion query has the following where clause: `WHERE id=$id AND course=$course` Can you confirm that the tblstudent table in your database has a primary key on the id and course field? Any other fields in the table must be included in the …

Member Avatar for devianleong
0
128
Member Avatar for sharmileekumari

You can use a ParameterizedThreadStart delegate like so: Thread workerThread = new Thread(new ParameterizedThreadStart(LongRunningOperation); workerThread.Start(a, b); However note that the parameters a and b are passed as objects, not as int's so you will need to cast them inside your method. public static Double LongRunningOperation(object a, object b) { if …

Member Avatar for darkagn
0
219
Member Avatar for somwang

You are probably better off having a single table in your database that just contains the votes of each user on each item being rated. This way you can ensure that each voter can only vote once for something. In order to calculate the total score, number of votes and …

Member Avatar for maringtr
0
376
Member Avatar for king000000

Hi king000000 and welcome to DaniWeb :) The play method should either: Start playing a track if the player is not already playing; OR Do nothing if the player is already playing. The stop method should either: Stop playing the track if the player is playing; OR Do nothing if …

Member Avatar for JamesCherrill
0
2K
Member Avatar for pritesh2010

You can use the RANK function to do this. [Here](http://msdn.microsoft.com/en-us/library/ms176102.aspx) is a link to MSDN's description of the function, and [here](http://www.databasejournal.com/features/mssql/article.php/3661461/New-Ranking-Functions-within-SQL-Server-2005.htm) is an excellent article that has some examples of its use. Something like this will work for you, you may need to change the order to get the way …

Member Avatar for poojavb
0
168
Member Avatar for darkagn

Hi Dani and other administrators/moderators, I have had little time recently to contribute to the site, but I noticed tonight that the number of members is fast approaching the 1 million mark - at the time of this post it is 952,959 members. At the current rate of new member …

Member Avatar for PrimePackster
0
198
Member Avatar for wjperdue

Hi wjperdue and welcome to DaniWeb You have two where statements which is incorrect. What you need is a single where statement, with extra conditions OR'ed or AND'ed together, so: WHERE HD_TICKET.HD_QUEUE_ID="6" AND HD_TICKET.CREATED BETWEEN [Start Date] AND [End Date] GROUP BY (HD_PRIORITY.NAME) should be better. Change the first AND …

Member Avatar for wjperdue
0
421
Member Avatar for poojavb

If InsuranceDetails can be null, you need to use a LEFT JOIN to join your tables together. SELECT ipd.InPatientID, ipd.Fname+' ' +ipd.LName as 'Patient Name' , -- this line is dangerous if name(s) can be null ipd.Gender, ipd.BirthDate, ipd.AccType as 'Account Type', ipd.Minor, ipg.GFName+' ' +ipg.GLName as 'Guardian name', -- …

Member Avatar for poojavb
0
335
Member Avatar for nicewave

This exception indicates that you have made a call that requires a filepath, and you have specified one that is too long for it to handle. Can you post a short snippet of the code surrounding where the error is thrown, or the stack trace message for the error? Try …

Member Avatar for darkagn
0
96
Member Avatar for prerit

Not sure if this is your only problem, but I noticed this line straight away: int zoom=50/100; So zoom = 0 which means that newWidth and newHeight both equal 0 too, so you are trying to create a Rectangle 0x0 and draw the image in that space. You see what …

Member Avatar for prerit
0
8K
Member Avatar for jbennet

Probably not an urgent one but thought I'd point it out anyway, all of my old, deleted PM's are back and set to unread. Luckily I only have 27 to go through (27 in 4.5 years, can it be so few??). Also, I can't see anywhere to delete them?

Member Avatar for Airshow
0
2K
Member Avatar for zachattack05

1. You could create your own Add method that passes through to the collection: public void Add(object item) { this.Items.Add(item); } 2. The CheckListBox.ObjectCollection that is returned by the Items property is a public non-sealed class so in theory you can extend it: public class MyCheckListBox : CheckListBox { public …

Member Avatar for darkagn
0
147
Member Avatar for zachattack05
Member Avatar for Simon180

If you want to mutate the string parameter you must declare it var in the procedure's signature: procedure TMainForm.Show(var s: String); But a better method would probably be to declare a local variable string to handle your error line, so: procedure TMainForm.Show(s: string); var n, n2, n3: integer; arTemp: TMyArray; …

Member Avatar for darkagn
0
152
Member Avatar for pawan768

This reply may have come too late, but if you draw a graph of the execution of the function will produce 11 edges, 9 nodes and 1 exit point. First we step into a loop (looks like a triangle of nodes in the graph). The middle of the loop provides …

Member Avatar for darkagn
0
194
Member Avatar for arunkumars

Try Application.Close() or Environment.Exit(int) methods. this.Close() closes the form but doesn't shut down the application.

Member Avatar for darkagn
0
237
Member Avatar for manhthaodn

The args parameter to the Main function is a list of command line parameters. If I run the following command from a cmd prompt: MyApplication.exe -e 5 Then args[0] will be set to "-e" and args[1] will be set to "5". Note that the arguments are strings already (since args …

Member Avatar for darkagn
0
90
Member Avatar for shanboy

Ok so your aggregate functions are anything appearing in the SELECT part of the statement that SUM, COUNT, AVG, MAX, MIN etc etc over one or more columns. For example, in your SQL query: [code] select orders.orderid,orders.customerid,orders.orderdate,orders.shipcity,orders.shipcountry, orderdetails.unitprice,orderdetails.quantity, SUM(orderdetails.unitprice*orderdetails.quantity )as total from orders inner join orderdetails on orders.orderid=orderdetails.orderid group by …

Member Avatar for shanboy
0
412
Member Avatar for carinlynchin

Most likely `data` is null. Can your method `App.getGenericData` return null and if so in what situation? Try wrapping the for-loop into an if-statement that reads `if (data != null)` and step through the code with the debugger to see what happens.

Member Avatar for Mitja Bonca
0
144
Member Avatar for Andy90

You need the reference to prjform to be global in the class calling the mouse click method. Example: [code] Project1.Form1 prjform = null; private void mouseClkbtn_Click(object sender, EventArgs e) { if (btnLatch.Text == "Latch Enable") // might be safer to use if (prjform == null) instead { prjform = new …

Member Avatar for Andy90
0
187
Member Avatar for M.Waqas Aslam

Transactions are very important in SQL. They provide a way of reverting previous steps of a multi-step operation on the database that causes changes should an error occur. Imagine this simple, common scenario. You want to represent a sale of items as a header (containing the date and time of …

Member Avatar for M.Waqas Aslam
0
341
Member Avatar for mnewsome

I believe a minimal instance of MSSQL Server is installed with VS2008. You can download the express version of MSSQL Server though. [URL="http://www.microsoft.com/sqlserver/en/us/editions/express.aspx"]Here[/URL] is a link to MSSQL 2008 R2 Server, you can google for MSSQL 2010/2012 Express versions if you prefer.

Member Avatar for Mitja Bonca
0
110
Member Avatar for kevinyu

[URL="http://www.digitalcoding.com/Code-Snippets/C-Sharp/C-Code-Snippet-Insert-Update-Image-To-SQL-Server.html"]Here[/URL] is a sample of how to insert/update image data. The sample code uses SqlClient instead of OleDB, but it should be a similar process. Your algorithm should be: 1. Read image file into MemoryStream using the Image.Save function. 2. Convert the MemoryStream to a byte[] using Stream.ToArray function. 3. …

Member Avatar for Mitja Bonca
0
280
Member Avatar for tommyarcher

Hi tommyarcher and welcome to DaniWeb :) Are you sure you want to use a stored procedure? Your sample looks like a simple query rather than a SP, which is defined like so: CREATE PROCEDURE SelectVendors ( @VCode INT ) AS SELECT [V_NAME], [V_PHONE], [V_STATE] FROM [VENDOR] WHERE ([V_CODE] = …

Member Avatar for tommyarcher
0
154
Member Avatar for walid86

The SetResolution function accepts to float's as parameters, you are passing to int's. To fix your error you need to pass like so: [code] back.SetResolution(300.0F, 300.0F); [/code]

Member Avatar for walid86
0
471
Member Avatar for libran

Hi Libran, To help debug your code, try adding some println statements to gain a better understanding of what is going on. Please see my comments below. import java.util.*; import java.io.*; public class FranchiseManagementSystem { private BufferedReader br; private String[] str; public FranchiseManagementSystem() throws Exception { br = new BufferedReader(new …

Member Avatar for stultuske
0
1K
Member Avatar for coolbeanbob

Once you have created the Customers table, you can't create it again unless you DROP TABLE first. You can use an ALTER TABLE query to alter the column structure of a table without losing data. Each INSERT statement can only accept one set of VALUES. You need to write three …

Member Avatar for BitBlt
0
157
Member Avatar for M.Waqas Aslam

JavaScript is a scripting language used most commonly to handle events in a web page. JSON is not a programming language at all, it is more like XML in that it represents data in a structured manner. While you may use one or both of these in your project, I …

Member Avatar for darkagn
0
237
Member Avatar for surajrai

One important use of overriding the ToString method in your classes is for consistency in the display of information in your views. It is far easier to override the ToString method than to remember the format used in each view for your class. Say for example that I have a …

Member Avatar for darkagn
0
548
Member Avatar for itsasif

Is your web app a WCF service? If so, you can just configure your client to connect to the base HTTP endpoint address and it should all hook up so long as the service implements the same operation contract as the client is after. If it's not a WCF service, …

Member Avatar for darkagn
0
98

The End.