Hey scriptick, in your code after line number 12, line(string) contains the entire text of the text file. And in line number 16 you are checking whether the line(string) is started with the inputted text or not. You asked something and you done something else.
By the way thanks for asking. 'm good, hope you too good (:
User Profile
Collapse
-
Hey scriptick, you are doing it wrong. 1) You should read your text file line by line and store it in an array. 2) Or in your code after reading the file once, split the string(line) using 'Carriage Return' and store it in an array. Then use LINQ (which Frinavale mentions) to extract the words which start with your input character from that array.
NOTE: You haven't closed your StreamReader in your code.Last edited by Frinavale; Oct 28 '13, 09:12 PM.Leave a comment:
-
Hey venomv1, i can guide you in your problem.
calculate_Click event method:
call ReadFile method.
ReadFile method: (return type void with no arguments.)
number1, number2 are strings
num1, num2 are integers
op is a character
First read your file and store all the contents in a string. Split the string by newline and store it in a string array. For every three lines in the...Leave a comment:
-
Hey EllahV, i don't know why you're getting an error message for 'label1' because you didn't shown the declaration part of it. But regarding 'buttn', the scope/life lies only inside the 'button1_Click' event method, you can't access it from the outside of it.Leave a comment:
-
Hey jinnahsma, try this...
Code:Dns.GetHostEntry("IP Address").HostName
Leave a comment:
-
Hey abdessamed1228, copy and paste the following code in Form_Load event and try,
Code:GraphicsPath path = new GraphicsPath(); path.AddEllipse(0, 0, this.Width, this.Height); Region region = new Region(path); this.Region = region;
Reference Link: How to create a non rectangular window form in c#?Leave a comment:
-
Hey hasmeed, try step 2 to step 6 from the following link...
how to have a single database for a LAN and server application in vb.netLeave a comment:
-
Hey cp0462, did you added 'AxWMPLib' reference to your project?Leave a comment:
-
Hey vmkrishna534, try this code...
Code:myEntity.Table_Name.Sum(a => a.field1 * a.field2);
Leave a comment:
-
Hey doctorj97, for your second question,
1) Install SQL Server Express edition in a machine which you want to act as server machine.
2) Allow TCP/IP connection in server machine. Open SQL Server Configuration Manager -> in left panel expand SQL Server [version] Network Configuration -> double click Protocols for SQLEXPRESS -> in right panel right click TCP/IP and select Enable.
...Leave a comment:
-
Hey MyDanes, in the inner query after the 'from' keyword mention both the table names and try...
Code:from MC_PART_LOCATION, PHYS_COUNT_TAG
Leave a comment:
-
Hey Prithivi989, i think we can't get the exact date.
Case 1: If the number is 12122012 means we can find out the date (12th December 2012).
Case 2: If the number is 122012 means we can find out the date (2nd January 2012).
Case 3: If the number is 1232012 means we can find out the date (3rd December 2012).
Case 4: But the problem is if the number is 1122012 means then can't say the exact...Leave a comment:
-
Okay.
Hey Syed Hadi, the mistake i noticed from your code is, codes from line number 36 to line number 134 should be placed inside the else statement after line number 27 in your code....Leave a comment:
-
Hey Syed Hadi, where is the insert query in your code? (The insert query you wrote was wrong.)
You've to use like this...
Code:SqlCommand myCommand = new SqlCommand("INSERT INTO TableName (Column1, Column2, ..., ColumnN) VALUES (@Param1, @Param2, ..., @ParamN)", myConnection); myCommand.Parameters.AddWithValue("@Param1", variable1); myCommand.Parameters.AddWithValue("@Param2", variable2);
Leave a comment:
-
vijay6 replied to how to allow to vote only once by controlling client IP in my poll website with c#?in .NETHey pod, whatever method we use we can't stop fraud vote for this scenario but we can reduce it. By capturing few more informations. Like what you said by capturing IP address, Mac address and Login & Vote, we can reduce it.
Why don't you suggest a proper avatar for me?...Leave a comment:
-
General syntax of select query.
Hey thomaaxha, in your code remove those square brackets '[' and ']' (which you used for where condition) and try......Leave a comment:
-
vijay6 replied to how to allow to vote only once by controlling client IP in my poll website with c#?in .NETHey pod, i've some doubts!!! What will happen if the ISP of the client allocates dynamic IP for the client whenever client connects to the internet?
Is this right?...Leave a comment:
-
Hey thomaaxha, you can use SQL COUNT() Function. Like this,
Code:SELECT COUNT[Column_name(s)] FROM [Table_name] WHERE [Condition]
After this check count value, if it is > 0 then value already exists in table else not exists.Leave a comment:
No activity results to display
Show More
Leave a comment: