|
Hi All. Could someone please explain me why when i add the column, and place the text in cell, the text is not displaying?
DataSet ds = DBEngine.GetOurSIS(Program.DB.Connection);
DataTable tbl = ds.Tables[0];
DataColumn col = tbl.Columns.Add("S_trot", typeof(string));
int ColIndex = col.Ordinal;
for(int i = 0; i < tbl.Rows.Count; i++) {
int CurrShipID = (int)tbl.Rows[i].ItemArray[1];
int CurrSumTrot = Program.DB.GetShipTrotil(Program.OurTeam, CurrShipID);
CurrSumTrot = 10;
tbl.Rows[i].ItemArray[ColIndex] = CurrSumTrot.ToString();
}
dataGridSIS.DataSource = ds;
dataGridSIS.DataMember = TblNames.TblNositeliName;
|
|
|
|
|
hi can some one help me ...
i want a stored procedure or query for selecting jobs when the user enters keywords ..
i couldnt find out how i can do that with "all words" and "any word"....
|
|
|
|
|
You can use OR conditions in the where clause of the query.
You will have to provide options of all words or any word in the UI.
According to the user preference you can change where condition in the stored procedure.
Consider following search query --
"some query with multiple words"
Then your where condition can go like this -
where text_data like '%some query with multiple words%'
OR
where text_data like '%some%' or text_data like '%query%' or text_data
like '%with%' or text_data like '%multiple%' or text_data like '%words%'
You can combine these 2 conditions together if you dont want to provide UI.
Then your where condition will be as this -
where text_data like '%some query with multiple words%' or text_data
like '%some%' or text_data like '%query%' or text_data like '%with%' or
text_data like '%multiple%' or text_data like '%words%'
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thanks
Hey i have a stored procedure
where i select the jobs based on LOCATION, FUNCTIONAL AREA, EXPERIENCE and KEYWORDS
KEYWORDS : they can add multiple keywords and there is a DROP DOWN LIST( with options exact phase, any words, all words)
How can i write the stored procedure for these three options...
Can you help me PLEASE....
|
|
|
|
|
You can send the search query directly in the KEYWORDS parameter and add another parameter to identify whether the keywords are to be searched for exact words or all words or anything else .... Using this parameter value your where condition changes accordingly.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hi,
i want to lock one of record that one user going to edit it, and dont set permission to other user (in network) to delete or update it
how can i lock record in database that use from some users in network?
|
|
|
|
|
Do you mean permanently or just until you finish a transaction?
You can easily lock rows while in a transaction, and they will be released when it is commited/rolled back.
BEGIN TRAN<br />
<br />
SELECT *<br />
FROM authors<br />
WITH (HOLDLOCK, ROWLOCK)<br />
WHERE au_id = '274-80-9391'<br />
<br />
<br />
<br />
COMMIT TRAN
source[^]
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
MySQL Update for 20,000 rows takes 4+ hours? Is this a bit slow?
I am using the ADO.net driver for MySQL that I downloaded from the MySQL website recently.
My database is not the most optimised I must admit but I can do the same with a text file in about 3 minutes (which is what I have had to resort to so is not ideal but gets the job done).
There are about 20 columns which are all Text fields or char fields.
I also noticed that doing a SELECT * FROM table WHERE id = 'XXX' is very slow...
The MySQL server is running on a Laptop which has an Intel Centrino 2GHZ with 512MB RAM and has been installed with the default settings.
I have also tried this with the MS SQL Server Mobile (I installed the older SQL Everywhere based on an article I read on this excellent site) and I get similar results with the speed of the SELECT and UPDATES.
INSERT is also quite slow after about 2000 rows have been added to the database.
I would appreciate any help or advice.
Thanking you in advanced.
Paul
|
|
|
|
|
How many indexes are on the table that you are inserting into? How many of them are clustered? If you insert large amounts of data into a table with clustered indexes, then everytime you do the insert information needs to be moved around.
One approach is to drop the indexes, insert the data and then recreate the indexes. The index creation only happens once (instead of 20,000 times) and is far more efficient.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Ok thanks for your reply. I will give this a try and will look up what clustered and non-clustered means.
I am a bit of a newcomer to SQL programming so I am on that learning curve right now....
Once I have found an improvement I will post my findings...
Do you think that my hardware, 2GHz Centrino Laptop with 512MB is sufficient. I understand that you can never have enough memory and will upgrade this soon... but it is not like my DB is Gigs of data!
|
|
|
|
|
I would have thought that the spec of your hardware was enough for testing purposes.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Say if all database on the server has the same structure, how do i query all of the databases available on the server? Can i do it in one single SQL query ?
The normal way to do this is to use multiple database selections. but this is too tedious (e.g: SELECT <column>.<db1> FROM <db1>,<db2>,... GROUP BY <column>.<db1> ORDER BY <column1> DESC). What happens if i have more then 30 databases of the same structure ?
Can anyone help me ?
Cheers
Sankai
|
|
|
|
|
i dont know what do u mean by same structure....do you mean you have some copies of a master database......then just construct the connection string properly with that provider name....you dont have to bother about the SQL Queries.....
keep your "connection string" in a module to act it as a global variable....
am i clear?? may be I didn't understand ur problem....
Tirtha
"A man can ride on your back only when it is bent....."
|
|
|
|
|
Hello all,
I am pretty new to sql databases. Please give me the syntax for update.
I need to confirm with what I am doing presently.
thanks in advance.
Keshav Kamat
India
|
|
|
|
|
Keshav V. Kamat wrote: Please give me the syntax for update.
What you want to update ? Table or DB ?
|
|
|
|
|
UPDATE [TABLENAME] SET FIELDNAME1='SETVALUE',FIELDNAME2='SETVALUE2',FIELDNAME3='SETVALUE3' WHERE ID='IDVALUE'
e.g
update employee set empname='Imran',city='Ahmedabad' where empid='1'
Best regards
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
Hi,
I am new to SQLExpress (although not SQL) and am about to create a project in C# using it instead of MS Access.
I am a bit confused about some issues and would like advice/guidence on these issues please:
1. In the VS2005 IDE I can view the db, add tables etc manually which avoids the need of moving backwards and forwards with SQL Server Manager which is good.
As I have previously distributed my Access db in a subdirectory of the main program without problems, I would like to think I can do the same with the new .mdf file.
When coding however, the connection string would appear to require it to point to the orginal db in VS2005 Studio as follows:
string dbLocation = @"d:\vs2005 projects\mybookings\mybookings\mybookings.mdf";<br />
string connectionString = "Data Source=.\\SQLExpress;Integrated Security=True;Timeout=60;Initial Catalog = MyBookings;Application Name=SQLExpressTest;AttachDBFilename=" + dbLocation;
If I point the connection string to the copy of the db file in the subdirectory of the main program (like I do with MS Access) then I keep getting connection errors.
The question is - "How will this affect my program when I distribute it as obviously the connection string will point nowhere?"
2. I think I must be missing some basic understanding of use and deployment of SQLExpress enabled programs and would appreciate any references to any online sites you may be aware of. I've looked at the MSDN site and read the information there and no doubt I will eventually master it. However, the above problem concerns me now and I don't wish to start of wrong and have to go back and re-do my code. Unfortunately, almost everything I can find on this subject relates to ASP.Net and vb (which I find difficult to interpret particularly when I am trying to learn the subject - not the language).
TIA.
PS. PLease forgive the xpost but I think in this case it was warranted.
Glen Harvy
|
|
|
|
|
Hello everyone,
I am working on an Windows Application writen in C# which gets connected to a remote Database server. I would like to be able to get the IP address of the users that get connected to the database server. In order to cheieve this, I am using the following code:
string strHostAddress = "";
IPAddress[] addresslist = Dns.GetHostAddresses(strHostAddress);
foreach (IPAddress theAddress in addresslist)
{
MessageBox.Show(theAddress.ToString());
}
Unfortunatly, for the users sitting behind a routher, I am only going to get their Enternal IP address such as "192.168.....".
I was wondering if it is possible to get the external IP address of the users?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
I have program that have a realation to sql DataBank I have no problem when I add/delete but my dataBank don't updated!i use this code for update:
dataAdaptore.update(mydataSet);
|
|
|
|
|
Hi
You must set Update Rule property in Relationship of your database
|
|
|
|
|
Please suggest me how to generate sql script for tables with data?
I hava some master tables contains data in it. I want to generate sql script with data. i.e., on run the script it should create the table structure and insert the data too.
Please suggest me...
|
|
|
|
|
dhananjayamurthy wrote: I want to generate sql script with data. i.e., on run the script it should create the table structure and insert the data too.
You can query the data structure with the views on INFORMATION_SCHEMA. Although, that is quite complex task - I usually leave it to the Enterprise Manager to generate the creation scripts for me.
Data population scripts are slightly easier. You SELECT the data from the table, but concat' it all into one columns
SELECT 'INSERT INTO TableName(PK, Col1, Col2) VALUES ('+PK+', '+Col1+', '+Col2+')'
FROM TableName
|
|
|
|
|
wrote:
You can use DTS package wizard to get the backup of table's backup.
Hope this helps you.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
i am usind dataadapter and dataset objects to bind some data from the database in the textbox control. the code i m using is as follows:
textbox1.databindigs.add("text",dataset.tables(0),"Name")
This code is able to retrieve the field 'Name' from the database and puts it in this textbox. Now i want that if some change is made in this textbox,then that should be updated to the database table as well. for this purpose i m using dataset.acceptchange method. But this is not giving result.
please provide code if possible....
thanks..
-- modified at 14:40 Monday 19th March, 2007
|
|
|
|
|
Hi
I have a stored proc that creates a job with a job step that runs an integration services package.
It all works perfectly fine if the stored proc is on the server where the job needs to be created. It creates the job on the server where the stored proc is located and thus called from. What would I need to change to be able to run this stored proc on the server where it is located, but have it create the job on another server?
Thanks,
RainFox - cunning, with some cloudy clueless moments, yet cool and fresh
|
|
|
|