|
What do you mean as interface to the ODBC items?
I don't completely understand your question. Please be more concrete, maybe I'll be able to help you.
|
|
|
|
|
I have a view that contains a list transactions, each of which are associated with a single routing number. Multiple transactions can exist for each routing number. Each transaction can be one of two types (a and b). I need to get the routing numbers, the count of transactions for each routing number, and then the count of those that are of type b, and the result set can only include transactions of type b (along with the requisite counts, of course). Can I get some guidance?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
One way is to have a nested query
select a.[transaction], b.tran_count
from transactiontable A
inner join (select [transaction], count(*) as tran_count from transactiontable group by [transaction]) as b
on a.[trasaction] = b.[transaction];
This is an off-the-cuff answer so it needs some looking into, but should start you down the right path.
|
|
|
|
|
I'll give it a try tomorrow. We came up with a three-select query, but it's evident that we know not what we do.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
select RoutingNUmber, count(TransactionNumber) as TransCount
from TransTable
where TransType = 'B'
group by RoutingNUmber
Does that help?
Tim
|
|
|
|
|
Nah, but that's okay - we have a solution (to use the term loosely).
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi,
I need to run a dynamic query baseed on a parameter.
Actualy I have a comboBox in my report filled with TableNames of my DataSource,
now I want to select all records of the selected table.
I've filled the combo but I'm confused how to run a different and runtime query
Best wishes
|
|
|
|
|
If I understand your problem, you can build a string like:
mySQL = "select * from " + me.Combobox1.selectedValue
Then execute the statement.
|
|
|
|
|
Either run a parameterised query or a stored proc, passing in the value form your combo box. Try googling either of those terms and you will find many examples.
Bob
Ashfield Consultants Ltd
Proud to be a Code Project MVP
|
|
|
|
|
If you are using ADO.Net, you can create a command object. By assigning different values to its "CommandText" property, you can conduct queries on different tables. Use ExecuteReader() method to get the result.
Please give more details on what API you are trying to use to get access to the database. That way people here can better answer your question.
|
|
|
|
|
Hello everyone,
I query the db and I get a number of rows returned.
They are displayed in a form with fields to be updated.
I know how to do the update on a one by one basis.
What I want to do is be able to update multiple rows at once.
Let say for example 5 fields per row and 10 rows.
There is something about arrays and loop thru it that I cannot get to work.
Any help would be greatly appreciated.
Thanks
Murali
|
|
|
|
|
I generally loop through a datatable and update each row individually, there are some articles around where an xml string is used to pass a collection of rows into the database for updating but I have never actually needed to use it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If the new values can be expressed by expressions, then you can use an update query to update multiple records and multiple fields.
For example,
Update MyTable Set Price=Price*1.05, ItemVolume=ItemVolume+100 Where Category='Electronics';
Hope this helps. Happy programming!
|
|
|
|
|
What language are you using for your front end? Some languages will support this.
For example, Java supports batch updates so you can loop through all the entries setting the update parameters for each in turn, then do an executeBatch to do the lot in one go. (OK, before anyone points this out, not all JDBC drivers support this.)
C# has something similar, although I've never used it myself. And if you can do it in C#, you can probably do it in VB.NET as well.
|
|
|
|
|
If using T-SQL you can use a join to populate the table with the information.
|
|
|
|
|
|
I want to run a software developed in C# using SQL Server 2005 express.I want to run this program in a different mechine which don't have Visual studio but it has SQL server express.Please help me.
|
|
|
|
|
Create one installer application. You can go for InstallShild or Setup Deployment Project directly from Visual studio. Add the .NET framework in the setup and build the application.
Install the application through your installer. You might ask for configuration data elements(such as username / pass for database) while you install.
|
|
|
|
|
Thank you Abhishek Sur.
I can understand what you are saying.But how can I include SQL srever 2005 express? It is essential to run the application.Some one says that changing the connection string configuration file I can run the application but I want to know the total process in details.
modified on Wednesday, January 6, 2010 1:14 AM
|
|
|
|
|
You are talking about 2 different things, C# is the client you have written and you need to write an installer to deploy that application to the CLIENT.
SQL Server is SERVER software and as such is designed to run on a SERVER unless you are using sql express as an embedded/single user database. A quick search[^] will give you plenty of resources to help with that
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All, I have two tables. I want to avg both number from table A and table B from the same cell.
2 3 4 3 4
Table A
1 2 5 3 1
Table B
I have two tables like above. I want to average from table one cell one and table two cell one then average both number and put into a third table or get the data and use it.
For example,
1.5 2.5 4.5 3 2.5
How do I do this in sql statement .
|
|
|
|
|
You would need a common key column as some SQL programs do not keep the order of the table.
|
|
|
|
|
djj55 wrote: You would need a common key column as some SQL programs do not keep the order of the table.
I am not sure what are you saying.but I do have a column that is comon for for both tables.
|
|
|
|
|
You may need to explain the terminology here because I have no idea what "cell one" means in your question.
If you use the term "field", "record", etc., you can make your question more understandable by others.
As for your question, you can make a query on the union of the two tables to find the averages.
|
|
|
|
|
Sory for the confusion. I should tell you that I am really very very beginer about database.
I will find out how to do union and query it.
thanks.
|
|
|
|