- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 8
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
80 Posted Topics
Re: Go to your dpr file and change the line [code] Application.CreateForm(TMainForm, MainForm); [/code] with what you need [code] Application.CreateForm(TYourLoginForm, YourLoginForm); [/code] | |
Re: That is because vbYes is always true. Instead of that, use [code] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If MsgBox("**** I'M WASTED", MsgBoxStyle.YesNo) = vbYes Then Form1.Show() End If End Sub End Class [/code] Also, in .Net world, you should use MessageBox. ![]() | |
Re: Your code worked for me and it's the same with the one Microsoft provided. Make sure that the user you are logged on has enough privileges(for win7 and Vista, UAC should be turn off) [URL="http://msdn.microsoft.com/en-us/library/2awhba7a.aspx"]Here[/URL] are some tips from Microsoft about CreateEventSource. Ionut | |
Re: Pascal is a procedural programming language. It is an alternative to C. Delphi is object pascal, something like visual C++: object oriented language based on pascal. What you do in pascal you can do with Delphi, but not vice versa. | |
Re: I found this in readme file of the provider : PgOleDb supports the following connection attributes: Provider - mandatory. Must be set to "PostgreSQL", "PostgreSQL.1" or "PostgreSQL OLE DB Provider" Data Source - server name or address location - database name User ID - PG user name to log in … | |
Re: You should build the value to write into a local variable of type string and after the for check if the last character is a comma or not. Then write the string to file and put a new line. Ionut | |
Re: Here is a way(maybe it is not the best): 1. write your sort procedure 2. define two form properties or variables : ListIndex and ValueFromIndex 3. when user clicks on a row (OnSelectIdem maybe, or OnClick), do - check if the previous row(the row with the index ListIndex) has the … | |
Re: An object is passed by reference to a method, so you don't need to add ref if you want to change its value. For example,in the case you posted, let's say Chromosome has a field called "name". If you assign other values to child1 and child2 as below, when function … | |
Re: Hi zack, As I see from your code, you select only quesItem from DB and dbReader knows only about that column. In the select clause, write all the columns you want to manipulate. [code] sql = "SELECT quesItem, quesSort FROM quesAll WHERE userCourse = '" + cmboCourse.Text + "' AND … | |
Re: it would be more helpfull if you pointed the line where compiler finds the error. But this statement(or logic) is not quite correct. [code] try { answer = book1.Price / zero; } [/code] You will get at runtime "Division by zero" and not a BookException. Use "throw" instead. [code] try … | |
Re: Yes, it is a right validation. But you can also write [code] if (textbox1.Text.equals(string.Empty)) { //do stuff } [/code] | |
Re: in the "Array" there is no field called "sortedByPrice" [code] var filteredByPrice = from b in Array where [B]b.sortedByPrice[/B] >= 10 orderby b.priceValue <= 20 //also, I'm not sure if this will work select new { b.PartNumber, b.quantityPrice, b.priceValue }; [/code] Ionut | |
Re: Hi, first of all, try using port number bigger then 1000. Windows reserves many of them for different applications. put echoPort, 5000 for example. Second, on the localhost there is any TCPServer that runs? When you try to connect through this code [code] using (TcpClient tc = new TcpClient("localhost", echoPort); … | |
Re: [code] char NullChar = char(0) [/code] should return the null character value. | |
Re: gtk, in c#, arrays and objects are passed to a method by there reference, so no ref is needed. About the error, the additional information is the inner exception? Can you post your stack trace? | |
Re: Hello Quagmire, To finish your program in an elegant way and make it more interactive, I suggest to define a record type like [code=pascal] type TMorseRecord = record EnglishChar : char; MorseChar : string; end; [/code] then define a constant array of type TMorseRecord [code=pascal] TMorseDictionary : array[1..26] of TMorseRecord … | |
Re: if you need to assign just those two values in the data structure, you may want to try Dictionary class. [code] Dictionary<string, string> list = new Dictionary<string, string>(); [/code] | |
Re: hi, if you know that always the first cell of a row must have a value in order to copy it, then you can try something like : [code] do while i < aValue if (Worksheet(1).Cells(i,1) <> "" then Worksheet(1).Rows(i).Copy Worksheets(2).Rows(i).PasteSpecial Paste:=xlPasteValues //here you apply the logic you need and … | |
Re: Hi, I see that you try to do a Bubble sort. The correct algorith is : [code] program Arrays; var a: array[1..5] of Integer; i, j, tmp: Integer; begin a[1] := 23; a[2] := 45; a[3] := 12; a[4] := 56; a[5] := 34; for i := 1 to 4 … | |
Re: Track down changes on database using Sql Profiler. With this tool you can see if it is sql's problem or VB's - it shows the exact values your code passes for the insert. | |
Re: Export data through c# code? Otherwise, from SQL Server Management Studio, right click on your database -> Tasks -> Export Data and follow the steps from the wizard. In the second windows ,"Choose destination", select Microsoft Excel. Ionut | |
Re: As I see from the code you posted, there are 2 GenerateSignature methods. One take 10 parameters and the other 11. When you call this function, you pass only 9(as the error says) parameters. You missed something at the last 2 parameters : out string normalizedUrl, out string normalizedRequestParameters | |
Re: [code] var s : string; i, e: integer; begin s := '6'; val(s, i, e); if i < 35 then //or whatever value you want do_something else do_something_else; end. [/code] I'm not sure if the val function exists in (Borland/Turbo) Pascal, i compiled this code in Delphi. Cheers, Ionut | |
Re: [code] SELECT * FROM ( SELECT row_number() OVER (ORDER BY AnyColumn) AS rownum, Column1,Column2, ..., ColumnX FROM YourTable) AS A WHERE A.rownum BETWEEN 10 AND 20 [/code] Ionut | |
Re: Hi, try this [code] oSQLConn.mySqlCmd = new SqlCommand("EXEC addNewCategory " + "'" + txtName.Text + "'", oSQLConn.mySQLConn); [/code] Ionut | |
Re: Maybe multithreading would help. Loop through database records and start a new thread for each request you have to do. Ionut | |
Re: Hi, I don't know the difference between Pascal and Watcom Pascal, but this code works for pascal: [code] var i : integer; begin randomize; i := random(3) + 1;// +1 because random returns a number between 0 and n-1, and arrays in pascal go from 1 to n writeln(array[i]); end. … | |
Re: hi there, Change your add method as following: [code] procedure TRoomForm.AddRoomClick(Sender: TObject); begin //currentroom := 12; not needed if adoquery3.Active then adoquery3.close; adoquery3.SQL.Clear; ADOQuery3.SQL.Add('Select max(roomnumber) + 1 as RoomNumber from Rooms'); adoquery3.Open; currentroom := adoquery3.FieldByName('RoomNumber').asInteger; showmessage(inttostr(currentroom)); end; [/code] Imagine a dataset(table, query) as a matrix. You have access to any … | |
Re: Create a non - clustered index on Word column. That will speed up your query. | |
Re: Without a tables' structure, it is hard to give an usefull response. As I can see, you need an inner join between table1 and table2, something like select tbl2_name from tbl2 t2 inner join tbl1 t1 on t1.tbl1_number = t2.tbl2_number where t1.tbl1_number = anumber Ionut | |
Re: Why don't you try to do a standard copy as below? [code] // arr.CopyTo(array); for (int i = 0; i < arr.Count; i++) array[i].name = arr[i].toString(); [/code] Ionut | |
Re: Hi, 1. [URL="http://msdn.microsoft.com/en-us/library/b142f8e7(v=VS.80).aspx"]Here[/URL] you can find some information about projects and solutions in Visual Studio(msdn website). A solution can include one or more projects, so when you click build solution, you choose to build all projects from that solution. If you want to build just a particular project, from solution … | |
Re: I would recommend you to use ListView control. It has a View property that might get you the behaviour you are looking for. View.Details sets the ListView to look like a table. Ionut | |
Re: try (c as CheckBox).Checked = false; Ionut | |
Re: I suppose you use a PictureBox, so use ImageLocation property to display the path of the current picture and .Load(textbox1.text) to open the picture. Ionut | |
Re: [code] procedure TForm1.Button1Click(Sender: TObject); begin DataSource1.DataSet := adoquery1; DbMemo1.DataSource := DataSource1; DbMemo1.DataField := 'description'; with adoquery1 do begin if Active then Close; SQL.Clear; SQL.Add('Select description from Rooms'); //adoquery1.Active := true; you don't have to make the query active as you open it in the next line. Open; end; end; [/code] … | |
Re: I haven't used/seen table before, but I think that is a type defined by the author. Probably [code] type table = array[1..100, 1..100] of real; //for example [/code] So in java you will have something like [code] double[][] table = null; [/code] Ionut | |
Re: > hashtable that accepts the value as an arraylist do you mean you want to insert objects? `System.Collections` has some classes that should help: `List<T>`, `Dictionary<T1,T2>` where T, T1, T2 can be of every type you want: string, int, long, object, collection, array, etc Ionut | |
Re: If you comment this line [code] SqlDataReader reader = command.ExecuteReader(); [/code] you will still get the error? Question 2. Ideally, you should have one connection to the database. So any other connection you create and use in a particular method should be closed and disposed. Ionut | |
Re: One way is to use events and delegates. Declare a delegate in your namespace [code] public delegate void AddCarEventHandler(Car aCar); [/code] in the form1 declare a method AddCar [code] private void AddCar(Car aCar) //Car is a class or struct that has all the elements you need to add. You can … | |
Re: Hi, Instead of [code] Console.WriteLine("The tax on {0}$ is {1}$ and The total is {3}$", price, tax, total); [/code] use [code] Console.WriteLine("The tax on {0}$ is {1}$ and The total is {2}$", price, tax, total); [/code] price, tax and total represent an array of strings that has the length 3. … | |
Re: if the string you mentioned will be the same until the semicolon, you can use something like this [code] string MyString = "FS:A151940.A-CM4;4"; string aString = MyString.Substring(0, MyString.IndexOf(';')) + value.ToString(); [/code] Ionut | |
Re: you need to do a left join with both your tables(as you want all records no matter if there is a match in company or/and user tables). [URL="http://www.developer.com/db/article.php/3739391/Implementing-a-Left-Join-with-LINQ.htm"]Here[/URL] is an example (it is in VB, but the Linq query is the same). Other solution would be to put an additional … | |
Re: change [code] command.Parameters.Add("@topicNo",SqlDbType.Int).Value = TopicNo; [/code] with [code] command.Parameters.Add("@topicNo",SqlDbType.Int).Value = Int32.Parse(TopicNo); [/code] Hope this helps. Ionut | |
Re: you can adapt the code from the following thread [URL="http://www.daniweb.com/forums/thread276551.html"]http://www.daniweb.com/forums/thread276551.html[/URL] | |
Re: You can also try to write the path into registry and read it from there when the application starts. Ionut | |
Re: try this code: this will go on Form1_Load [code] dataBaseBallDataContext db = new dataBaseBallDataContext(); var Players = from p in db.Players select p; List<Player> lstPlayers = Players.ToList(); playersDataGridView.DataSource = lstPlayers; db.Dispose() [/code] this is for seach by last name: [code] dataBaseBallDataContext db = new dataBaseBallDataContext(); var SearchPlayers = from p … | |
Re: The algorithm that checks if a string is palindrome is [code] Dim sInput As String Dim i As Integer Dim bIsPalindrome As Boolean bIsPalindrome = True For i = 1 To Len(sInput) / 2 If Mid(sInput , i, 1) <> Mid(sInput, Len(sInput ) - i + 1, 1) Then bIsPalindrome … | |
Re: [URL="http://msdn.microsoft.com/en-us/library/ms189794.aspx"]DateDiff help[/URL] [Code] select * from Table where DateDiff(dd, DateColumn, GetDate()) > 7 --gets records older than 7 days select DateDiff(yy, t.Birthdate, GetDate()) as Age from Table t [/code] And there are many other examples in the link above. Ionut | |
Re: [QUOTE=Simon180;1204366] information in string looks like this: Name RanK [/QUOTE] From this, I understand that the string looks like Name<CR><LF>Rank (Name#D#ARank). If you want to split it, use Pos and copy functions. [code] iPos := Pos('#13#10', yourString). Name := copy(yourString, 1, iPos-1); Delete(yourString, 1, iPos + 1); //delete <CR><LF> //now, … |
The End.