|
hdv212 wrote: if i don't want to use FTS (Full Text Search) in Sql Server dataBase, can i use normal search like this in table that contained .mht files :
Select * from mht_Archive_Table where mhtContent like N'%microsoft%'
No. That's why I directed you towards the CONTAINS and FULLTEXT commands.
hdv212 wrote: my another question is that did u use .doc to save to database ?
1. can u search text in it ? if yes, how ?
Yes - I saved doc files to a database and I used Index Server with CONTAINS and FULLTEXT to search on it. That was why I told you to do this - I wasn't just posting for finger exercise.
|
|
|
|
|
Hello
I found some good example to get a connection to a mysql db using mysql dataconnector
It is also easy to fill a dataset and a datagridview
BUT I found no tutorial nor any information explaining the basic concept to upgrade tables from the datagridview
Any basic information about that will be WELCOME
Below the basics to get the connection and fill a datagridview
MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection();
string MyConString = "server=localhost;port=3306;uid=root;database=recutex;";
string selectcmd;
conn.ConnectionString = MyConString;
conn.Open();
MySqlDataAdapter adaTour = new MySqlDataAdapter();
selectcmd = "SELECT distinct dag,chauffeurID FROM `tours`";
adaTour.SelectCommand = new MySqlCommand(selectcmd, conn);
DataSet dsTour = new DataSet();
adaTour.Fill(dsTour);
dgv_Tour.DataSource = dsTour.Tables[0];
|
|
|
|
|
|
Thank you
It helps a little
But still do not explain the management between datagrid and dataset to get changed row and update them in tables
The datagrid is owned by the form, the dataset can be owned by the function doing the select. If I have another function doing the update do I have to declare the dataset at the form level ?
Sorry if my question seems stupid but I'm coming from old C and very new to C# programming !
|
|
|
|
|
You find basic knowledge here[^].
For a tutorial, have a look here[^].
What you should keep in mind is that the BindingSource object is responsible for keeping your DataTable synchronized with the DataGridView . Any changes made in the DataGridView will automically be made to the DataTable object. To get the changes back into the database, you need to call the Update() function of the OleDbDataAdapter with your DataTable passed as argument.
SkyWalker
|
|
|
|
|
Hello
It becomes clearer !!
What I understand is that I have to use a BindingSource instead of the DataTable itself
But I'm using a Dataset not a datatable : does it make any change ?
The BindingSource must of course be declared at the form level as the datagrid
But the DataTable or Dataset can be declared into the function as because Bindingsource will handle underlaying data
Is it correct ?
|
|
|
|
|
DataTables are in the DataSet: YourDataSet.Tables[0] would be the first table.
You declare and set a variable whenever you need it, You can use it as long as it does not go out of its scope.
SkyWalker
|
|
|
|
|
Hello
It seems that it is not necessary to use the binding source
The Dataset.Getchange method can be used to get modified rows
BUT : there is a problem with deleted rows : the are virtualy added by the getchages but seems empty
How to manage Deleted rows ??
|
|
|
|
|
In order to track the update status of any given row, the DataRow object has a RowState property that displays one of these DataRowState enumeration values:
- Added
- Deleted
- Detached
- Modified
- Unchanged
Have a look here[^], please
SkyWalker
|
|
|
|
|
Thank you
But I already know this....
My question was : HOW to get the original key of deteted row
When I do a getchange() I get all the affected rows with their status : modified, added , deleted
For modified and added rows, the data are accessible and I can use the key to apply in DB
But for deleted row I see nothing (I mean in the debugger)
How can I get back the original information of a deleted row to use the primary key to delete it in the DB ??
|
|
|
|
|
Hello, Finaly I've found a simple way that seems to work very well
MySqlCommandBuilder cb = new MySqlCommandBuilder(adaAddr);
DataSet ch = new DataSet();
ch = dsAddr.GetChanges(DataRowState.Deleted);
adaAddr.Update(ch);
ch = dsAddr.GetChanges(DataRowState.Modified);
adaAddr.Update(ch);
ch = dsAddr.GetChanges(DataRowState.Added);
adaAddr.Update(ch);
return;
|
|
|
|
|
I'm making a program that coverts a regular every day sentence into a random code of numbers and letters. Would anyone know how I could make so when a key is pressed the text is changed to a number or letter that I pick?
|
|
|
|
|
I'm assuming you're using a richTextBox or textBox. But look at the KeyPress[^] event of the control, use can use the event args to determine which key was pressed. Handle the key that was pressed as you wish.
He who makes a beast out of himself gets rid of the pain of being a man
modified on Tuesday, February 19, 2008 4:19 AM
|
|
|
|
|
Hi All,
Stuck in a weird position. I have written a code which lists the various documents in a folder.
As soon as I click on the names of the documents they open up as they are. Word files in Microsoft Word, Excel in Excel etc...... The functionality works absolutely fine as long as I am debugging.
As soon as I fire the same Application from IIS 5.1, the listing is proper, but on the click of the names nothing happens. I have even checked the taskmgr and can c the respective processes like WINWORD.EXE, EXCEL.EXE running, but I cannot c the docs.
Can u guys help me plz?
|
|
|
|
|
Hey,
I think i understand how to asynchronously call a method so that the main thread isn't blocked until it ends. I also think i know how to use the Thread class for the various threading scenarios - starting etc, synchronizing, ThreadPooling etc. I have also read about when an application should consider multi-threading and when it should be avoided.
However i don't know when to go with an Async call over using the Thread class?
Any help much appreciated.
Simon.
|
|
|
|
|
I think here[^] you will learn when to create new threads.
SkyWalker
|
|
|
|
|
Exactly what i couldn't find. Many thanks.
|
|
|
|
|
|
Converting value type into reference is Boxing, and vice-varsa is UnBoxing.
|
|
|
|
|
ReenaSharma wrote: Converting value type into reference is Boxing
Almost.
You don't "convert" anything - boxing is the process of placing a primitive type in an object so that the primitive type can be used as an object. See this Wikipedia[^] link.
/ravi
|
|
|
|
|
let's say we have these 2 classes. Class B inherits from class A
class A
{
}
class B : A
{
}
in the following code
A obja;
B objb = new B();
obja = objb; // boxing
B objc = (B)obja; // unboxing
We can say,
Boxing is assigning an object of the child type to an object of the parent type (higher in the inheritance hierarchy)
Unboxing is (casting) assigning an object of the parent type to an object of the child type.
see also
Eslam Afifi
|
|
|
|
|
Eslam Afifi wrote: Boxing is assigning an object of the child type to an object of the parent type
No, that's not correct. There is no boxing going on there.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Maybe I'm wrong, but this is how I understand it, and I'll be grateful if you clarify this point to me, please.
B objc = (B)obja;
Isn't that unboxing?
Eslam Afifi
|
|
|
|
|
No, that's not unboxing.
Unboxing is when you extract the value from a value type that is stored as an object. What you are doing is merely changing the type of a reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank you. Now I get it. But I have one question. Does this reference conversion consume much time as unboxing?
Eslam Afifi
|
|
|
|