HI, I'm using Visual Web Developer and SQL Server 2005 Express Editions. I have a database with two tables, say AccountsTable and PersonsTable, with a one to many relationship respectively.
Given a particular selected record in PersonsTable, I need to look up the corresponding master record in AccountsTable. Here's what I've done:
SqlDataSource1 has a "SELECT * FROM PersonsTable" and a GridView1 which uses this as its datasource and the 'enable Selection' checkbox is On. This works fine.
Then, I create a second SqlDataSource2. When I click on the WHERE button in the Configure Data Source page, I have chosen the following parameters:
Column:PrimaryKeyField; Operator:=; Source=Control; ControlID=GridView1; Default Value='I left this blank' but the Value field shows GridView1.SelectedValue when I click the ADD button.
I have bound DetailsView1 to SqlDataSource2. When I run the page, the GridView1 is shown with Persons records OK. Then I click the 'Select' next to a record in the Gridview expecting the corresponding lookup to the master record (Account) to be shown in the DetailsView, but it does not show anything.
What am I doing wrong? Is there a better way of doing this?
Your help is much appreciated. Thank you.
PS. I could find Tutorials showing Master/Details retrieving records in a top down fashion (1:n), but I could not find the reverse (n:1)
Step 1. First I am filtering the Sales Order information and inserting it in my Sales Orders table. Step 2.Then I am filtering the details from the sales Order and inserting them in the respective table.
My Problem is that the Sales Order File does not contain the Sales Order key (ID), this is generated by the SQL Server. How can get it in order to use it in the second step? I need it because it is a foreign key in the details table.
Master table (tlbProduct) having productID as Primary key and which acts as reference key for table (tlbCategory).Fields for tlbProduct are productID,productNameFields for tlbCategort are productID,CategoryID(primary key),CategoryName,Prizeboth productID,CategoryID are autoincrementing.but when i write two inserts simultaneously as follows insert into tlbProduct(productName)values(@productName)insert into tlbCategory(CategoryName,Prize) using sqldatasourceI get the error that ProductID value is null which is not providedBut (productId in both is autoincremented) and relationship is there in both tables How to resolve this problem without adding ProductID in second Insert?SWati
My question is setting up master detail pages using stored procedrues. In the tutorials C# Master-Details (Seperate Pages) example they use the following code for the master page for the navigation. <asp:HyperLinkField HeaderText="View Details..." Text="View Details..." DataNavigateUrlFields="au_id" DataNavigateUrlFormatString="DetailsView_cs.aspx?ID={0}" /> The call to the Details Page DetailsView_cs.aspx uses the following code <asp:SqlDataSource ID="SqlDataSource1" Runat="server" SelectCommand="SELECT dbo.authors.au_id, dbo.titles.title_id, dbo.titles.title, dbo.titles.type, dbo.titles.price, dbo.titles.notes FROM dbo.authors INNER JOIN dbo.titleauthor ON dbo.authors.au_id = dbo.titleauthor.au_id INNER JOIN dbo.titles ON dbo.titleauthor.title_id = dbo.titles.title_id WHERE (dbo.authors.au_id = @au_id)" ConnectionString="<%$ ConnectionStrings:Pubs %>"> <SelectParameters> <asp:QueryStringParameter Name="au_id" DefaultValue="213-46-8915" QueryStringField="ID" /> </SelectParameters> </asp:SqlDataSource> I can replicate the example calling the detail page but I am unable to make the detail page work when using a stored procedure as the asp:SQLDataSource. Using the above sql code as a stored procedure in the <SelectParameters> I am not able to return the data set using either asp:QueryStringParameter or asp:Parameter as I have built other forms using stored procedures and have tested the procedure and know that it works. Can someone point me in the right direction. Thanks
i have go master records as well child records how do i delete all the master records so that all my corresponding child records get deleted ,as we do in oracle using undeleted cascade
I am having problem in getting result out of two table, one table is Item Mater which stores global items for all offices and other is stock file which stores office wise stock items as follows:
ITEM MASTER -------------- NCODE ITEMNAME 1 A 2 B 3 C 4 D 5 E
I want office wise stock details which inludes items found in stock file and remaining itmes from item master. example for office 1
-------------------------------------------- FOR OFFICE - 1 -------------------------------------------- ITEMCODE ITEMNAME OFFICEID -------------------------------------------- 1 A 1 2 B 1 3 C 1 4 D NULL 5 E NULL
i want a single view from which i can select data like i shown above, any kind of help is highly appriciated, what i tried is , i created union of both tables and tried to get data out of union view but result is not up to desire.
Is there anyway I can return only the last row of a query, like TOP does for the top most items?I would like to return something like this:SELECT BOTTOM 1 Column_CFROM Table1WHERE Column_A = somethingAny help would be greatly appreciated. Thank you!
Does anyone know of a way to determine the code of a stored procedure that was built with encryption? I inherited a db with many of these and we are not sure which version of the source code exists on the server. Alternatively, can I compile a new SP and compare it to the old one in any way other than testing lots of data?
Is is possible to write a query that does the reverse of a cross tab query, I have a table that is mirrored for our Main frame, the table contains a item number a warehouse number and a date field and then 43 fields like field01 thru field43 which store quantities, each field out from 01 is another date our from the date field and I need to look for the item, warehouse and return a date where one of the many field is greater than or equal to the quantity I am looking for, I obviously will have to calculate the date field but thought If I could do the reverse of a cross tab giving a resuld set of 43 records for everyone in the first file I could do a quick update for item number, warehouse match and quantity field greater than what i need returning the date
blah blah blah , sorry I made it sound so confusing
I'm really sure it's not some complicated formula (because I managed to recover other fields) . I just want to reverse the formula used to "encrypt" this data. Thank you. Excuse my english.
I have a friend who has installed MSDE over SQL Server 6.5 - by doing so he broke some other apps that required a SQL 6.5 DB, he realises now it was a mistake on his part and would like to revert to SQL 6.5 again and recover his data, is this possible or has he lost all his old data?
1. Is there a stored procedure, or a way to reverse engineer a database? I have a lot of legacy dbs that I have inherited that I need to create a recovery system for. Part of this is creating the scripts to build all of the tables and I would like to automate it.
2. How can I output the results of a stored procedure to a text file? When I run sp_configure I would like that information to go to a text file.
I have built several cubes. However I would need to create local cubes from the built cubes in Analysis Services. As a result I need to work out the DDL for my existing cubes. However the cube contains many mdx calculated members. I was wondering if it would be easier to simply generate the DDL from my existing cube in Analysis Services.
Does anyone know any third party tools that I can use to reverse engineer the DDL from the built cubes in Analysis Services ?
I`d like to find a script that will create a "create" script for an entire database. It would write a create-table script for every table in the database, complete with all the PKs and FKs too.
Since I`m asking for the world (or at least the world`s creation script), then I`d also like the script to (optionally) write insert statements for all the rows currently residing in all the tables.
Do you have such a script? If not, can you give me a couple of pointers to assist me in writing my own?
I need to search a string starting at the end to find the last space in the string, so I can determine the position of the last word in the string. Any ideas on how to do this are greatly appreciated. Kellie
does anybody know of a script which can reverse engineer a database to a flat file - aprt from the one which is in enterprise maanger. I want to schedule a job to run once a week to compare the DDL of the database to make sure there are no changes ?
If I use _reverse_ wildcard search will it always result in a tablescan? Is it possible to get the DB (Oracle or SQL server) to useindexes when doing reverse wildcard match?let's say I have:table email_address (id int, email varchar)with the following entries2, www.%shoes.%3, w%.super%shoes.%4, %webbox.somecopany.comselect id from email_address where 'www.superdupershoes.com' likeemail;this returns 2,3But the query always results in a table scan even if I add an index toemail. What kind of index can I employ in this situation?Please note that this is a _reverse_ search, the opposite of what'snormally done, i.e. select from email_address where email like'www.%shoes.com'.Thanks!- Robert
I have notice that i missed few columns in my merge repliction and i wonder is it possiblie to reverse a replicated database or copy to normal SQL database?
In Crystal Reports, there was a "reverse sign for display" property that could be checked for a number box. This was used for debits and credits (and such) so a negative number would be displayed as a positive and a positive displayed as a negative.
How would this work, or is there something simple, in Reporting Services?
I am writing a chat bot for IRC in C#. I am using an Access database (for portability etc) - I have a table called tblResponse, it contains a column called Trigger this contains trigger strings, such as:
% wassup%!%
These contain wildcards etc so that they will match different things spoken in the channel, so the above should match:
hey wassup!! whoah, a bot ... wassup!!
etc. Because this is comparing general conversations, I am doing sort of a reverse search, in that it is not what I am passing in that I am using as the search string, it is what is in the column of the database that serves as the search string. I don't want to have to store the chat text in a temp table and loop through the Response table, calling sql queries for every entry - but all the queries I have tried do not work as intended.
I have tried switching the select query variables like this (this is called from c#, so for here i have just inserted a test value):
SELECT * FROM tblResponse WHERE Trigger like 'hey wassup!!!';
This returns nothing, so does:
SELECT * FROM tblResponse WHERE 'hey wassup!!!' like Trigger;
Is there anyway I can perform such a search within a sql query that can be processed by MS Access? To recap (in case I have done a poor job explaining this)... I need to use the database entries as the search criteria, if that criteria matches the incoming text string (using the wildcards in the database entries), then return that row - the exact opposite of a convensional 'search' query.
Hi, I need to get first entries orderd by datetime asc, but I need the newest of this block returned first. Imagine to have some entries:
08:00 ... 09:00 ... 10:00 ... .... ... 15:00 16:00 17:00 .... I want to get the first 3 but the highest in time first. Like this: 10:00 ... 09:00 ... 08.00 ...
Hi,I'd like to reverse engineer the schema definitions in the SQL Serveron a daily basis and store them in a version control system.Could anyone please let know if there are any tools to reverse engineerthe entire schema definitions in the SQL server. I'd like somethinglike the perl script 'dbschema.pl' for the Sybase ASE.Regards,Dellit.
I wanted to make a .NET wrapper class that parses a database for a given stored procedure, and finds the name and type of each of it's parameters.
to do so, i need to do the following:
normally, you have a stored procedure and you know its parameters and their types (i.e. int, varchar, etc), based on that, you hard code a call for this storedprocedure on your backend code.
I want to make a wrapper class that goes and finds out what the parameters for an existing stored procedure are, and based on them, create a GUI that allows people to fill them. after people fill this Form out, and click submit, i generate the proper procedure call.
this would basically allow me to create a single class that i can just call to create a form for any given storedprocedure...
I have a SSAS 2012 Tabular Cube and I am now stuck with a problem concerning something recursive in DAX.Basically I am looking for number of zones jump, provided the sign of the numbers are reverse.E.g. in the figure below. Number of zones jump for the figure -47,067 is 1, since there is a positive value in zone 2. If the Figure in Zone2 had been 0 or a negative number and Zone 3 had the same (i.e. 0 or a negative number) and Zone 4 had a positive number, the number of Zones jump would be 3. Is this something that could be done in DAX?
I'm working with parent-child hierarchies. My source is AS2005. What I have now is: + parent 1 child 1.1 child 1.2 child 1.3 + parent 2 child 2.1 child 2.2
What I would like is: child 1.1 child 1.2 child 1.3 + parent 1 child 2.1 child 2.2 + parent 2
This would allow me to simulate subtotals for the hierarchy in a more financially intuitive way. I call it a simulutation because the optimal solution would be to use a normal group for the parent-child hierarchy and then apply group-headers and -footers. However, this does not seem possible and the documentation I've found also describes parent-child hierarchies wrt. the details-group only.
I have thought sorting the data - perhaps on levels, but I haven't got anything to work yet. One of the things that annoys me the most when developing in RS2005 is that it's very hard to debug the layout. For instance, when I apply sorting - first ascending then descending - and the result is the same I get no messages telling me what's wrong (which there obviously must be...).
I have table with columns as ID, DupeID1, DupeID2. ID column is unique. DupeID1 and DupeID2 -- the combination should only be there once. I don't want reverse combination of duplicates, i.e. DupeID2, DupeID1 in the table. How can I delete the reverse duplicates from this table?
I have a data (txt) file which has the following structure
M_ID1: CID11,Date11 CID12,Date12
M_ID2: CID,Date21 CID,Date22
My problem now is it, to get that into a table (MID,CID,DATE) as the text file "groups" CID and DATE by MID and I have no idea how to read the file and transform it.