|
Raman samineni wrote: I need to write all in one query
What would you gain from having it in a single statement? As PIEBALD stated, you can put them in a single SqlCommand and execute them.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello sir
Thank you. My out put was
Supervisor- AgentName-Hours-Tran-Completed,
when I ran the qry i need to get this report.
Regards
Raman
|
|
|
|
|
Raman samineni wrote: when I ran the qry i need to get this report.
You could put the other query in there too, as a subquery. The other queries might be combined, depending on "what" you are selecting from. I have not seen a corrected version of that code yet; I suggest you start writing and testing
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hello sir,
How all three statments be written as one query.
Regards
Raman
|
|
|
|
|
how I will put in the sql Command all three query
Thanks
Raman
|
|
|
|
|
Raman samineni wrote: how I will put in the sql Command all three query
Do you need them in a single "sql statement", or do you need them in a single "SqlCommand"? For either way you have been given a solution - did they not work, and if so, what went wrong?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
send me both, No problem
Thanks
Raman
|
|
|
|
|
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
|
|
|
|