|
Raman samineni wrote: send me both, No problem
AFAIK, we're volunteers here. Why should I provide two pieces of code??
The first query from your list is simply invalid, as it lacks a FROM statement. You can search on the internet what a "subquery" is and how to write one, and try to combine that code as suggested. Also reread PIEBALDs' suggestions, there's a good reason they get upvoted every time.
Good luck, you'll need it
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hello sir,
My OUT PUT Report was
SuperName Agent Name Hours Trans Compl
Thanks
Raman
|
|
|
|
|
I can't help you, sorry.
We gave quite some answers and options, and your response was "write them both for me". Unless you can answer whether you need them in a single SqlCommand or as a single Sql-statement, there will not be any progress.
Now, it doesn't add anything of value to have them in a single statement, but I'm willing to help. When I say "help", I mean that I can point out how some things are done, it does not mean that I am going to write YOUR code.
|
|
|
|
|
yes, that is true, I need them in SQLCOMMAND or String query in the program
I appreciated
Raman
|
|
|
|
|
You're welcome
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi friends,
I want to know the future of SSRS in SQL .
|
|
|
|
|
Arul R Ece wrote: I want to know the future
Hang on a second, while I go fetch my crystal ball.
Arul R Ece wrote: of SSRS in SQL
There's a 95% chance that it will still be supported in the next five years.
Anything particular that you're worried about? If not, I suggest bookmarking their blog[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
i need source code of replication database in c#. who can help me?
|
|
|
|
|
pashmakjoon wrote: i need source code of replication database in c#.
This is not a take-out restaurant.
pashmakjoon wrote: who can help me?
MSDN[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
i can't find your code.
where is your code?
|
|
|
|
|
He left it under a rock outside. Have you gone out and looked for it?
|
|
|
|
|
I didn't supply any; the relevant sections are in the manual, and it takes some study and configuration.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
pashmakjoon wrote: i need source code of replication database in c#
Major databases have tools in the database itself which is used to replicate the database.
|
|
|
|
|
Dear all:
I am trying to use C# to communicate a small database build in Access 2007. I can read from the database and I can modify the values and save the changes back to database using the DataGridView. However, I am not sure how to modify the values programmatically.
Here is the code building the connection.
string g_ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\TestDB.accdb";
DataSet g_ds= new DataSet();
OleDbConnection g_con = new OleDbConnection(g_ConnectionString);
OleDbDataAdapter g_adapter = new OleDbDataAdapter("Select * from qrySuggestion", g_con);
g_adapter.Fill(g_ds, "qrySuggestion");
this.dataGridView1.DataSource = g_ds.Tables[0];
g_con.Close();
I have a button on the form and when the button is clicked, save the changes back to the database. The code is as follows:
public void SaveTable(string tblName, DataTable tbl)
{
g_adapter = new OleDbDataAdapter("select * from " + tblName, g_con);
OleDbCommandBuilder bu = new OleDbCommandBuilder(g_adapter);
g_adapter.UpdateCommand = bu.GetUpdateCommand();
g_adapter.Update(tbl);
tbl.AcceptChanges();
g_con.Close();
}
I can use the above code to read from the database and display the data in the DataGridView with no problem. And I can make modification in the DataGridView and save it back by calling the SaveTable method.
However, the problem is that I want to make modification programmatically and reflect the changes back to the database. What I did was to add two statement at the beginning of the SaveTable method as:
DataRow row = tbl.Rows[0];
row[0] = 30;
assuming the column 0 i.e. row[0] is a int field.
When I add those two statement at the beginning of the SaveTable method. An exception will occur at g_adapter.Update(tbl); the exception is something like:
Missing DataColumn"pk_ID" in SourceColumn "pk_ID" in DataTable "tblSuggestionBase"
Can anyone help me out with the problem please?
Thanks
Asura
|
|
|
|
|
Hi,
I want to know how can I split spilt in MySQL stored procedure.
I have this string Jassim Loves Banana
I want to split it by space and add x to it so it will be
xJassim xLove xBanana
|
|
|
|
|
use replace as
SELECT REPLACE('Jassim Loves Banana', ' ', ' x');
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
one more question please..
if I have the string as
jassim rahma
or
jassim ali rahma
or anything else
how can split that to be:
<pre>SELECT file_no, old_file_no, account_number, id_number, full_name, date_of_birth FROM patients WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION) and MATCH(full_name) AGAINST('rahma' WITH QUERY EXPANSION) ORDER BY full_name;</pre>
|
|
|
|
|
I am using the following statement:
SELECT * FROM patients WHERE MATCH(full_name) AGAINST('jassim ali' WITH QUERY EXPANSION) ORDER BY full_name;
what I want to display all records contains jassim and should also contains ali but getting totally different result! here are names I am getting in the result:
Abdul Rahma Salma
Ali Jassim
Jassim Rahma
Jassim Rahma
Mohd Ali Ahmed
Mohd Jassim Maki
|
|
|
|
|
Never tried that. But I guess, and AND with two clauses could do the trick:
SELECT *
FROM patients
WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION)
AND MATCH(full_name) AGAINST('ali' WITH QUERY EXPANSION)
ORDER BY full_name;
Please try, and report failure or success.
|
|
|
|
|
I tried it but still the same problem. I am getting result which has no relation to the string entered! here is my result:
Abdul Rahma Salma
Ali Jassim
Jassim Rahma
Jassim Rahma
Mohd Jassim Maki
because it's returning Jassim OR Rahma but I want Jassim AND Rahma
|
|
|
|
|
I have the developers edition of SQL SERVER 2008r2. The only choices showing up in my BIDS project types is Business Intellegence. Does anyone know how to get VB.net or Visual C# choices to show up??
|
|
|
|
|
I am developing C# winForm application. I have a textbox for searchign customer name but I want the user to enter the customer name like this:
john mathews
Or:
Robert Duff
then in MySQL I want to have a dynamic sql to search search the customer_name like this:
SELECT * FROM customers WHERE customer_name CONTAINS john AND customer_name CONTAINS mathews
|
|
|
|
|
See the sticky at the top, it tells you how to get an answer to your QUESTION, ou actually need to ask a question rather than make a statement.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Get the value of the texbox, split it into a string[] and use the elements of the array as parameters into your SQL query. Note, do not use string concatenation to create your query but proper SQL parameterisation.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
this is in C#.. but can this be done in SQL level?
|
|
|
|