Thxx Sir, but it isnt working eithr :( it is giving hell lot of errors
Rizwan Rathore
Posts
-
How to Access TextBox in my own class -
How to Access TextBox in my own classHi I am totally a new commer in VB or VB . Net i m trying to make a simple windows application. that has two textboxes in it. i want to make my own student class with two members Name and gpa. and two methods one to assign the values to the variables and the 2nd one to show them in the textboxes. and i want to access this class in another class by creating its object in it. i am having following problems. i) textboxes r not accessible in my student class. ii)when i added these variables and function in the Form1 class (for the textboxes to b accessible) and created the object of Form1 in my own class i was unable to access the variables and methods of Form1 class. I am giving the code as well.
Public Class Form1
Inherits System.Windows.Forms.Form
Private name As String
Private gpa As Double
Public Function assignvalue()
name = InputBox("Enter the name of students")
gpa = InputBox("Enter the name of studentsFather")
End FunctionPublic Function showvalue() textbox1.Text() = name textbox2.Text() = gpa End Function
Public Class MyClass
Dim s1 As New Form1
s1.assignvalue()
s1.showvalue()
End Class
End Classnow when i run this program it gives error on s1.assignvalue() and s1.showvalue() D:\VB Projects\WindowsApplication1\Form1.vb(168): Declaration expected. somebody plzz help me out looking forward for help Regards,
-
Accessing DatabaseThxx Sir, it was really very helpful and written in very easy to understand manner....thxx once again :) Regards,
-
Accessing DatabaseHi All i have no experience of working in vb or vb dot net although i have worked a little bit in C# dot net. now i have to access a database using VB.Net the database i m using is ms access so plzz anyone tell me that wat is the best and easier to implement way of doing it Looking forward for help, Regards,
-
realizing a URL using Regular ExpressionsSorry if u mind that i will avoid that in future but sir i was using exactly same regular expression wich gave exception :( so wot shud i do now :(???
-
realizing a URL using Regular ExpressionsHi Sir, thats exactly wat i need but when i tried the program i got this exception
An unhandled exception of type 'System.ArgumentException' occurred in system.dll
Additional information: parsing "(?(mailto\(news|(ht|f)tp(s?))\://){1}\S+)" - Too many )'s.
at this instruction
string urlRegex = @"(?(mailto\(news|(ht|f)tp(s?))\://){1}\S+)";
now i am totally new commer in C# so plzz tell me how can i correct this i am writing the same code which u sent... so plzz reply back soon looking forward for help Regards, -- modified at 14:30 Friday 9th June, 2006
-
realizing a URL using Regular ExpressionsSir i want to do this using C# and want to know about the RegularExpression class of C#.... any help in this regard will b welcomed looking forward for help Regards,
-
realizing a URL using Regular ExpressionsHi All, I am developing a search engine and i m using "." as a seperator of a token..... but now i have to search URLs as well so anyone plz tell me how can i realize that a particular string is a URL..... looking forward for help Regards,
-
want to know the index of ArrayList during BinarySearchi really thought that it just returns a bool value....now i understand a little bit....but it wud b really helpful if u illustrate it with a little example thxx in advance regards,
-
PROBLEM IN FILE PATHthxx alot sir it is working now :)
-
want to know the index of ArrayList during BinarySearchHi all, I am trying to develop a text mining engine and in it i need to work on large number of files...and deal with lots of words... i ve made a word class which has following variables
public string term;
public int df;
public ArrayList tf = new ArrayList();
public ArrayList docID= new ArrayList();
public static int count;here term is the variable wich contains the actual value of the word. now when user queries for a word i need to search all these terms and find out whether the term user wants exists or not.... i ve this word class sorted w.r.t the "term" variable so it means that i can apply binary search for finding the user query.....i m doing this by adding all the term variables of the class in an arraylist and then applying binary search over it....but the problem is that i need to know the index of the arraylist where the user's queried term exists.....and i dont know the way to find out the index :( i ve added the sample chunk of code here.....anyone plzz help
//adding all the term variables of Terminology class to the allTerms ArrayList.......
for(int i = 0; i < Terminology .count; i ++ )
{
allTerms.Add(word[i].term);
}//queryList is the ArrayList that contains the pharase queried by the user in the form of //one string at one index
for(int j = 0; j < queryList.Count; j ++)
{
if(allTerms.BinarySearch(queryList[j]) >= 0)
{
need to know the index of allTerms ArrayList.
}
}looking forward for help Regards,
-
Using the results found by google desktophahahaha well i already knew that but i really needed it :( so i thought y not just give it a try...anyways have fun byee
-
PROBLEM IN FILE PATHsir i dont know much about xml i m just using to save data from C# and then use this data to display in a web page... so the sample code is something like this
< data >
< cluster label = cricket >
< document id = 1 > c:\cricket.txt < \document >
< document id = 1 > c:\hockey.txt < \document >
< document id = 1 >c:\hockey & cricket.txt< \document >
< \cluster >
< \data >
<\pre>looking forward for help
Regards,-- modified at 13:56 Thursday 1st June, 2006
-
Using the results found by google desktopHi all, I have installed the software google desktop in my pc now i want to display the results found by google desktop in my own form i.e. i want to pass the query to this software and then get the documents found by it and the summary of the document how can i achieve this using C#... looking forward for help Regards,
-
PROBLEM IN FILE PATHHI ALL I AM SAVING FILES PATHS IN AN XML FILE BUT THE PROBLEM COMES WHEN THE FILE NAME CONTAINS "&" SIGN.. THE XML FILES GIVES ERROR THAT WHITE SPACE IS NOT ACCEPTED AT THIS PLACE SO ANYBODY PLZ TELL ME HOW CAN I GET RID OF THIS PROBLEM LOOKING FORWARD FOR HELP REGARDS,
-
Sorting Array of objectsRobert Rohde wrote:
if (word[j] == null) MessageBox.Show("word array at index " + j + " is null");
Sir it is showing entire array of word as null.....but it works perfectly fine without sorting..........how can all the values changed to null??
-
Sorting Array of objectspublic class Terminology : IComparable
{
private string term;
private int df;
private int qTf;
private double qWeight;
private ArrayList tf = new ArrayList();
private ArrayList position= new ArrayList();
private ArrayList docID= new ArrayList();
private static int Count;public int CompareTo(object obj) { Terminology w = (Terminology) obj; return( w.term.CompareTo( w.term )); }
//only method in this class other than properties and constructors
public void incDF()
{
df++;
}
}now moving to TextMiner class
public class TextMiner : System.Windows.Forms.Form , IComparable
{
const int WORDS = 20000;
public Terminology[] word = new Terminology[WORDS];
public void Indexer()
{
Array.Sort(word);
}
private string strValue = "term";
public int CompareTo(object obj)
{
Terminology w = (Terminology) obj;
return( strValue.CompareTo( w.term ));
}
}it gives this exception An unhandled exception of type 'System.NullReferenceException' occurred in 2ndAssignment.exe Additional information: Object reference not set to an instance of an object. and on this statement
for(int j = 0; j < Terminology.count-1; j++)
{
sw.Write(j+1 +"\t"+word[j].term.PadRight(20,' '));
}and the exceptions comes when the value of j is 0....m really confused :( looking forward for help Regards, -- modified at 5:43 Wednesday 24th May, 2006
-
Sorting Array of objectswell the exception doesnt come during sorting it comes after the sorting the statement i m cofused about is the use of private string strValue = "term"; isnt there any error in this statement?? i mean term is the variable of terminology class and i m declaring it as a string value in TextMiner class how will this work??
-
Sorting Array of objectssir it also didnt work :( i ve written the same code in the CompareTo function which i ve written in TextMiner class but it made no difference again same exception :( is there any way out of this ?? looking forward for help Regards,
-
Sorting Array of objectsBoneSoft wrote:
word = Array.Sort(word, new WordComparer());
well i ve tried this already but it gives compile time error that cant covert type void to type TextMiner.Terminology[] :(