DataSource Controls :: Perform Sql Queries Onto Vb.net And Display Them?
Apr 26, 2010
I get from SQL Server Server Data. I need to use datas form 2 colums of my SQL query for a VB.NET. The VB.NET need 2 values for both colums and produce 1 answer. I what to display the value on the same line instead of the 2 1st values. How can i store the 2 colums wich lot of SQL values on my vb.net script and diplay the result with the other data from the SQL query ?
View 3 Replies
Similar Messages:
Mar 5, 2010
SELECT 1000000*QuantityNC/Quantity AS PPM FROM [table1] However I need my WHERE clause to do thisI need the above calculation depending on BusUnit, which is linked to PartNumber, which is in the above table. also it has to be by Company (which is selected from a dropdown). And also based on the current month and year.
PartNumber and CompanyName are in [table1]
BusUnitID, PartNumber, SupplierID, are in tblParts
BusUnitID and BusUnit are in tblBusUnits
View 2 Replies
Jun 28, 2010
I need to fire sql queries in my website and get the results from the Database. for example: I will give select * from emp in a text box. It shud return the results for me. DO any of u have a sample/links of such application, through which i will be able to implement in my application share me the links/sources/app if u have any.
View 2 Replies
Apr 20, 2010
i want to display results from multiple queries in a repeater... is it possible? for example, a user searches for a keyword "test" i search 4 different databases for it, and display results from all 4 in one repeater.
View 2 Replies
Feb 11, 2010
(ie.)C-Chennai
B-Bombay
-Hydrabad
A-Andhra
K-Karnataka
It may comes any order but (cbhak) is constant. i need to bring this in query, i dont want to use any funtionHow can i acheive this result
View 2 Replies
Feb 14, 2010
My web application calls a stored procedure and stores the result in a .NET datatable. I'd like to use this datatable and join it with other tables in my database. Is this possible?
Would the best way to set this up be to create another datatable and then use a dataview to join both datatables?
View 2 Replies
Mar 2, 2010
I have the following query:
[Code]....
The results look like this:
DocumentNumber NIIN QtyReq AvailBalance
12345 015551212 2 5
12346 015551212 1 5
12347 015551212 3 5
12348 015554787 10 12
As you can see, the first 3 documents are for the same NIIN, and their total QtyReq is 6, however there are only 5 Available for this NIIN.
I need a way to remove the document 12346 because it cannot be filled, the other 2 document can though. I cannot figure this one out, but it seems like it should be pretty easy.I am using MS SQL Server 200
View 3 Replies
Feb 26, 2010
how to wrote stored procedure for check two queries result this result is same return true value its not same return false value
View 2 Replies
Feb 4, 2010
I know there has to be a way to do this but for some reason I keep getting it wrong. I have one query which pulls all of the cities from a zipcode database like so:
[Code]....
Then I have another which counts the records from a transactions table per city, like so:
[Code]....
Only the zipcode is stored in the transactions table, so the idea here is to get a list off all the distinct cities that reside in the state. Once I have the cities, I want a count for each city as a whole, so I need to go back in and get all of the zipcodes that make up one city, and then count the transactions for those zipcodes. It works using the first query above, looping through them and then executing the second for every pass. But shouldn't there be a way to do it all in one query?
View 4 Replies
Jul 28, 2010
I'm currently working on a FOREX Live Trading project that I'm implementing.
I already have a database that stores the CURRENCY PAIR, BUY/SELL, PRICE AND QTY.
But I have a huge problem.
Scenario that is:
A person BUYS EUR/USD at a PRICE of 1.29900 @ quantity 100,000. (This will be recorded in the database table)
Then he BUYS EUR/USD at a PRICE of 1.29950 @ quantity 100,000. (This will then be recorded in the database also)
Then he decides to SELL his EUR/USD at a PRICE of 1.31000 @ quantity 200,000 all out. (How can I check from the database if he previously had make a transaction of BUY/SELL, so that I can do my necessary calculations for the P/L Statement)
View 3 Replies
Mar 17, 2010
I am having trouble with queries because they are not returning the data needed, and I am having trouble figuring out why because I only am testing with 2 records.First I want a query to return all records for one customer as follows:
[Code]....
There are two records with the customerID of 1, but it only returns one,next I try to return only one record, the AccountPrimary or customer_contacts.IsPrimary, but when I add " AND customer_contacts.IsPrimary = 'True' "at the end of my query it then returns both records, but only one IsPrimary = True and the Other = False. Is it backwards? I also tried another method and it returned 30 of the same record and I only have 2
View 4 Replies
Mar 4, 2010
(1) "...this application is a very heavy SQL application, it does not perform a session based SQL connection, instead for every request it refers back to the base confirmation file on the web server and then opening or making a new SQL request the result being a very chatty SQL client!"(2)..." concerns specifically relating to the chattiness of the SQL client app. Please be cautious when "testing" the product for it may have a negative effect even on [the] faster WAN links"C. Example of Code(1) from a class helper file:
"
public Product GetProductByName(string name)
{
[code]...
View 4 Replies
Jan 16, 2010
I am planning a project for a pharmacy to enter quality control data to generate reports and graphs with Crystal Reports. There are 20 stores, I need to password protect the entrance page, giving each store their own username and password (just one per store is fine), allowing the store to only access that store's data. Each store will have an associated ID in the MSSQL table.I am using the Membership Provider. I know I need to implement user roles for Managers and Stores levels (Managers can run reports for all stores), I wonder if I can set the default store ID for insert/edit templates after that specific store logs in.Basically, I think I need to filter SQL queries based on the store ID associated with a user ID. I have seen a .NET site that, after logging in, you type in a store id into a textbox, and it gives you access only to that stores data. Something like this would work for my situation.Can anyone explain or show me an example for the best method to accomplish this with C#?
View 2 Replies
Jan 26, 2010
I trying to create a search mechanism for records in a EDM based on text entered on a text box in a web page.
For example, if I enter a partial name of a customer and/or state abrebiation for that customer on the Text Box (abc, TX)s, I want to search name and state fields in a Customer table in my database for matching customers.
I found a solution with the namespaceSystem.Linq.Dynamic, but for some reason it is not working. It does not expose the Search() method. Here is the code I am using to perform the search;
[Code]....
View 3 Replies
May 12, 2010
when i want insert a record i see an error like this
Can't perform Create, Update, or Delete operations on 'Table(MainMenuLink)' because it has no primary key.
with this codes:
MyLinqDataClassesDataContext db = new MyLinqDataClassesDataContext();
MainMenuLink li = new MainMenuLink { Link ="../error/error.aspx", LinkSubject = "subject" };
db.MainMenuLinks.InsertOnSubmit(li);
db.SubmitChanges();
ShowLinks();
what is the problem?
my table have a primary key but i dont know why give an error!!!
View 3 Replies
May 3, 2010
i'm quite new to asp.net and have been working on a simple way for users to send messages to each other....
the messages work fine, users can send and reply, however, i want a way to tell the users when they have a message and how many...
how to do this in simple terms and supply vb code if possible.
View 2 Replies
Jun 27, 2010
Is it possible to perform an update command which performs addition using a value from a textbox? For example: User inputs a number into TextBox1 (I use regular expression validation to ensure this is an integer).
[Code]....
Basically if the user inputs 5 into TextBox1, I want the update command to subtract 5 from that user's ballance.
View 2 Replies
May 25, 2010
I am working on asp.net 3.5 and in MVC using Linq to SQL classes. In my MVC project i am calling stored procedure using linq to sql that conatin query joining two tables.Below is my code in Partial class
[
Function(Name="dbo.GetUserWiseThreadDetail_SP")]
[ResultType(typeof(Thread))]
[ResultType(typeof(Reply))]
public
IMultipleResults GetUserWiseThreadDetail_SP([Parameter(DbType="VarChar(30)")]
string userID)
{
ExecuteResult result = this.ExecuteMethodCall(this,
(MethodInfo)(MethodInfo.GetCurrentMethod())), userID);
return ((IMultipleResults)(result.ReturnValue));
}
In one of the controller i have made one more class
public class
MypostIndexData
{
public
IEnumerable<Thread> Thrds {
get;
set; }
public
IEnumerable<Reply> Repls {
get;
set; }
public MypostIndexData(IEnumerable<Thread>
thrds,IEnumerable<Reply> repls)
{
this.Thrds=thrds;this.Repls=repls;
}
}
finally coding of controller action method
ForumDataContext pmforum = new
PMForumDataContext();
public
ActionResult MyPosts(string userId)
{
IEnumerable<Thread>thrds;
IEnumerable<Reply>repls;
IMultipleResults result = pmforum.GetUserWiseThreadDetail_SP(userId); (this satement doesnot give any result,if i execute stored proc in
sql it give the results)
thrds = result.GetResult<Thread>();
List<Thread> thrdlist =
new
List<Thread>(thrds);
repls = result.GetResult<Reply>();
List<Reply> replylist;
if (repls !=
null)
{
replylist = new
List<Reply>(repls);
}
return View(new
MypostIndexData(thrds,repls));
I am unable to understand why i am not getting any results?
View 5 Replies
Feb 25, 2010
Is there a way to combine the LINQ queries together and have access to both of the results independently?
[Code]....
View 10 Replies
Mar 15, 2011
I got this error message when I use rowfilter
Line: 938 Error: Sys.WebForms.PageRequestManagerServerErrorException: Cannot perform '=' operation on System.Int32 and System.String.
My code is like this
[Code]....
When I check only string, it's okay
But I have to check string and int because some columns are only Integer such as LLMS_Id, Risk, RsidualRisk
View 1 Replies
Feb 22, 2010
I am accepting query/queries from user (our support team) in a text box where user can enter only one query or multiple queries. I need to display result of all queries entered in the textbox. If it is SELECT statement then result of that statement in grid which is done. If UPDATE/INSERT/DELETE then total number of rows affected which is also done but if only one UPDATE/INSERT/DELETE statement is entered in the textbox.
If user enters 2 UPDATE statements and then a SELECT statement then how can I get number of rows affected for individual UPDATE statements just like SQL Server Qury Analyzer displays messages in its result pane.
e.g.
(6 row(s) affected) -- first UPDATE statement
(4 row(s) affected) -- second UPDATE statement
(16 row(s) affected) -- for SELECT statement (grid will also be displayed along with these messages).
I tried almost everything, SqlDataSource (returns count of first statement only), SqlCommand.ExecuteNonQuery and DataAdapter.Fill (returns count of last statement only).
View 3 Replies
Feb 5, 2010
In general terms, which way will require more server processing power and which way will return faster queries... if there is even a difference. The client's database is still on the dev MS SQL server but is essentially but the client has decided they want to collect two more fields of information. Both fields are going to be collection text data and probably varchar(300) will be sufficient for the column data types. Would it ultimately be more efficient to
Add two additional columns in the main table so the data is entered directly into each record, or Add an additional table (or two) with a foriegn key to the primary table that holds the info for each new field The SELECT statement for the main table could be modified to either add the new columns (a.NewColumn1 and a.NewColumn2) or it could contain nested SELECT statements that pull in the data from the other tables. Custom daisy-chained Insert or Update statements would be no problem and a cascade Delete relationship would take care of any deletions. I'm just trying to figure out which would be better from a performance standpoint?
View 3 Replies
Dec 7, 2010
I have a gridview that pulls data from two tables, CLIENT and PAYMENT. I want to add the edit, delete functions to the gridview for the payment portion of the table, that is to edit or delete the payments but not the client. I've manually enabled the edit, delete functions and input the queries. I've also deleted the textboxes from the templates which draw from the CLIENT table so they cannot be edited. Everything looks good on the surface until I actually go to edit or delete anything, and it has no effect.Here's the structure of the two tables:
CLIENT PAYMENT
ClientID Pk PaymentNumber Pk
FName CLIENT$ClientID Fk
LName PaymentDate
ContactNo NULL PaymentAmount
ArrivalDate PaymentDetails NULL
DepartureDate NULL
CurrentResident
Here's the update query:
UPDATE [PAYMENT] SET [PaymentDate] = @PaymentDate, [PaymentAmount] = @PaymentAmount, [PaymentDetails] = @PaymentDetails WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate
AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails) OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))
Finally, here's the delete query:
DELETE FROM [PAYMENT] WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails)
OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))
View 3 Replies
May 11, 2010
when i want insert a record i see an error like this Can't perform Create, Update, or Delete operations on 'Table(MainMenuLink)' because it has no primary key. with this codes:
MyLinqDataClassesDataContext db = new MyLinqDataClassesDataContext();
MainMenuLink li = new MainMenuLink { Link = "www.tprogrammer.com", LinkSubject = "subject" };
db.MainMenuLinks.InsertOnSubmit(li); [code]....
View 2 Replies
Oct 26, 2010
I'm trying to pull data from two queries and want to display each row seperately in the view. Here's what I have so far, but it's not working.
I added this model
[Code]....
And added this method in the controller
[Code]....
View 1 Replies