|
Normally, it's along the lines of
INSERT INTO table1
SELECT values FROM table2
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks !!
Bawa
|
|
|
|
|
hi, I've this problem :
we work with a sql database which operates in accent-insensitive mode,
once I've cached some data from it to my .NET application, how can I search within this data (contained in a DataTable) with an accent-insensitive query?
I mean I'd like to obtain the same result (i.e.) " André "
in any case if user is searching for:
DataTable.Select("name LIKE 'andré')
DataTable.Select("name LIKE 'andrè')
DataTable.Select("name LIKE 'andre')
thanks to anyone may answer
Darx
|
|
|
|
|
Not sure which CultureInfo to use but I'd recommend setting the Locale propery of the DataTable. Try Invariant culture setting - it should ignore accents.
|
|
|
|
|
thanks for your reply, I've tried but with no success. It seems there is no way to directly perform an accent insensitive research with Select() function in a DataTable as like as in sql environment.
could somebody suggest a workaround?
|
|
|
|
|
Hi all,
Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 ....
Many thanx .... again.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
How do you mean? Surely if you are hitting the DB, then you will have access to the connection object which would have this info?
|
|
|
|
|
Yes you are correct ... but I have no idea how to retrieve that object ?
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: but I have no idea how to retrieve that object ?
In order to connect to a database you must need some sort of connection. That connection object will have a IDbConnection.ConnectionString[^] property implementation from the IDbConnection interface. (So it doesn't matter what type of Connection object you have, you can always access it through the interface )
|
|
|
|
|
in MSSQL:
select db_name()
|
|
|
|
|
Many thanx for the response, If I run select db_name() it returns the name of the database, the thing I looking for is the actual database package name, like MSSQL or MySQL, does it make sense, is it possible?
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
What can be wrong when the Configure Data Adapter Wizard doesn’t generate any UpdateCommand?
_____________________________
...and justice for all
APe
|
|
|
|
|
did your adapter just miss:
adapter.MissingMappingAction = MissingMappingAction.Passthrough;<br />
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;<br />
??
or
maybe your query does not return the primary-key-columns
if this is the case, you won't get an UpdateCommand
greetings,
Ralf
|
|
|
|
|
Warnat wrote: maybe your query does not return the primary-key-columns
So I have to write an update-query on my own??
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
When I'm trying to copy the contents of a dataset to another dataset,I'm getting an exception "Cannot Find Table 0".But When I debug I could retrieve values for the dataset.
Please help me in resolving this issue.
Thank you,
Regards,
Deepa.
|
|
|
|
|
how do you copy ?
my solutions allways follow this scriplet:
please make sure, you copy the values into a row
which you retrieved from the Table you are copying into
DataRow new_row = desttab.NewRow();
now begin filling the values into new_row[xx]
in the end append this row to the dest_table:
desttab.Rows.Add(new_row);
hope this helps
Ralf
|
|
|
|
|
hi i need to write query to find the databases presented in the database objects
|
|
|
|
|
Rmesh wrote: i need to write query to find the databases presented in the database objects
I have no idea what that means.
|
|
|
|
|
i have foind out the databases present in the database for ex, if we have databases like crm,sqm,love etc then i have to write the query to list out these databases
|
|
|
|
|
Rmesh wrote: i have foind out the databases present in the database
Do you mean the databases present on the server?
Rmesh wrote: i have to write the query to list out these databases
If you have SQL Server 2000 (and you haven't specified which technology you are using - please state this, it is important) the query would be something like:
SELECT * FROM master..sysdatabases
|
|
|
|
|
thank u its working now how to write query to list tables under the database
|
|
|
|
|
check out the INFORMATION_SCHEMA views. they will give you all this data. in particular for tables in views:
select * from INFORAMATION_SCHEMA.TABLES
if you want a comprehensive data dictionary of your database, check out the link in my sig below.
|
|
|
|
|
iam having an emp table
and i want to display recs randomly each time i retrieve
with regards
ravi kiran
|
|
|
|
|
|
Are you talking about a System.Data.DataTable that's already populated and you want to pull a random record from it? Or are you talking about writing a select statement that randomly selects a row?
If it's a datatable you could use Random.Next(DataTable.Rows.Count) to get a random integer with a maximum value set to the row count.
If it's a sql query you want to write you could get a random number based on the RAND() function and the COUNT() function then write something like:
DECLARE @Id INT, @Count INT, @Rnd INT
SELECT @Count = COUNT(*) FROM table
SET @Rnd = CAST((@Count*rand())+1 AS INT)
SELECT TOP (@Count) @Id = Id FROM table ORDER BY CartNumber
SELECT * FROM table WHERE Id = @Id
If you're not using SQL 2005 you'll have to build the SELECT TOP query as a string and call EXECUTE instead.
|
|
|
|