Datasource To Populate DDL - Then Choose Item
Jul 9, 2007
I've got a page with a SQLDataSource control successfully populating a Dropdownlist...
However, now I find I need extended functionality - so I've got another page with links to this page, using querystrings - I need to hit the page, check the querystring, and if it's blank, just continue, but if the querystring is populated, then choose that item. I've tried the page_load and the page_prerender, but so far, it's not working:
CC = Request.QueryString("center")
If CC <> "" Then
' DropDownList1.Items.FindByText(CC).Selected = True
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(CC))
End if
I've double checked, and yes, every time CC is populated, that item is definitely in the dropdownlist - it just doesn't get changed to that item.
ideas?
End If
View 2 Replies
ADVERTISEMENT
May 15, 2006
Can someone tell me what I am doing wrong... I am trying to populate some textboxes from a table by doing a SELECT statment.
Any help would be greatly appreciated
T.
Code:
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
myConnection = New SqlConnection("Server=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CustomerInfo.mdf;Integrated Security=True;User Instance=True")
myCommand = New SqlDataAdapter("SELECT * FROM [CustomerSalesNum] WHERE [WorkSheetID]= '" & lblRWorkSheetID.Text & "'", myConnection)
Dim ds As DataSet = New DataSet("CustomerSalesNum")
ds = New DataSet("CustomerSalesNums")
tbUPPRice.Text = ds.Tables["CustomerSalesNums"].Rows[0]["Price"].ToString();
View 5 Replies
View Related
Jan 24, 2008
I have a report that contain at least 7 subreports. Each with their own datasource. I have set the subreports datasource to the correct datasource and on a few of them passed in parameters.
however, upon running it I noticed that the reports would show "SubReport cannot be shown". I made sure my parameters were being passed and its of the same type.
I googled and found a lot of examples that used the 'LocalReport_SubreportProcessing' event to populate the datasources for each subreport.
Is this the right way to go about it? I cannot find any good examples of how to populate a subreport. I need to justify putting the logic like this inside the ReportViewer form rather than someplace else.
Could someone please shed some light on this for me?
I am using VS 2005 C#, Sql 2k, on Windows Server 2003. I am using Reporting Services however the reports in my project are .rdlc files not .rdl they are inside my Windows Project not a Reporting Project...if this matters.
Any help asap would be greatly appreciated.
View 3 Replies
View Related
Dec 6, 2013
I have a BOM table with all finished item receipes and semi items recipes. create a query where semi item materials are also listed in finished item recipe.
View 5 Replies
View Related
Mar 6, 2007
Hi,
Here's my problem. I have 2 tasks defined in my Control Flow tab:
EXECUTE SQL--------->EXECUTE DTS 2000 PACKAGE
When I attempt to run it, by right-clicking the EXECUTE SQL task, and selecting "Execute Task", it only runs the EXECUTE SQL part (successfully), and does not "kick off" the EXECUTE DTS 2000 PACKAGE, after it is done running (even though it completes successfully, as shown by the green box).
Yes, they are connected by a dark green arrow, as indicated in my diagram above.
Why is this?? Am I missing something here? Need help.
THANKS
View 3 Replies
View Related
Jul 12, 2007
Hello,Basically, I have a table with 2 fieldsId item#1 33332 33333 22224 22225 22226 33337 33338 3333I would like to only select the last identical Item# which in this case would be the id 6,7 and 8Any idea how could I do that?Thanks
View 1 Replies
View Related
Jan 18, 2007
hi everyone
what the matrix's class name ?
where is the matrix's dll?
Can i create a new class extends the matrix?
I want to override the matrix's onpaint method.
Can i do this ?
why the table not have the column group?
View 9 Replies
View Related
Oct 16, 2014
I am having trouble finishing the last bit of a report. The report shows orders that customers have placed that contain 0 promo items, All promo items (all items in order are promo items), and a mix of promo and non promo (at least 1 promo item and 1 non-promo item). Ive simplified this a bit for ease of understanding but lets assume we have 2 tables: A Promo table that contains the items on promotion and the dates that promotion is valid, and a Sales table, that contains the order number, order date, and sku ordered.
I've already written code that finds orders that have at least 1 promo item in them, and using that, I can determine what orders have 0 promo items in them. Where I am stuck is taking the orders that have at least 1 promo item in them, and separating them into orders that have only promo items, and those that have both promo and not promo items in them. Also, there are several promos throughout the year (called "Offers") so in my code below, you can see 2 different Offers ("JF" and "MA") with their corresponding dates they are valid. They will never overlap. My results also have to be split out by Offer so management can look at the results of each offer separately. Here is some code:
Code:
create table #Promos (
Offer varchar(2) null,
SKU int null,
StartDt date null,
EndDt date null
[Code] ....
So my results should show OrderNo A1111 in the Promo and No Promo group because of SKU 5 not being promotional during the time that order was placed. OrderNo A2222 should be in the Promo Only group because both SKUs on the order were promotional at the time the order was placed.
View 6 Replies
View Related
Oct 24, 2007
I have a production server log shipping to a secondary server every 30 minutes (both SQL 2000), which the second server is used for both a warm standby server and for reporting from users. Issue: the log shipping locks the DB so reporting can't be done until the load is finished, the load to the second set of databases has taken up to 15 minutes to finish allowing the users only 15 minutes to run reports, this is not acceptable. The server also needs to be used for DR.
I am looking for another solution, I can't use Transactional Log shipping as not all of the tables in the databases have a primary key identified. So, I am looking for a real-time or near real-time reporting server that is more available to running reports and a warm standby server for Disaster recovery. I am trying to figure out what SQL Server 2000 has to provide (or even 2005 or 2008?) or I am also looking at some third party software, but not sure what is the best for a reasonable price.
Any help is appreciated.
Thanks....JB
View 8 Replies
View Related
Feb 16, 2005
Hi All,
I have a dilemn:
On one side, I have a column C1 which could be a primary key because it is never null, the value is unique and identify the record. The problem is its a char type and its lenght can be close to 30.
Then, I've planned to add another column C2 of int type as PK. But then I need to add a unique constraint index on C1. Does it improve performance anyway?
Thanks
View 14 Replies
View Related
Jul 6, 2006
good day, everyone
if i have a transaction table with fields below :
transaction_no, product_id, product_desc, product_qty, product_txn, transaction_date
can some expert here point out to me , which is the best cluster-index and non-clsuter index ?
and possible kindly please explain why is it so? i'm not good in database so just explain like to beginner
thank you very much for guidance
View 3 Replies
View Related
May 6, 2008
(Hard to put a good subject on this one...)
I have a database containing a lot of users and these users can have four different kind of telephone numbers connected to them: "Direct phone", "Switchboard", "Cell phone", "Home phone". The phone numbers are stored in a separate table. Some users have 0 phone numbers, some have 1, some have 3 etc.
Now I have to transfer the data to another database with a strict table structure and here the table that contains the user also should contain the users phone number and an alternative phone number, if the user currently has more than one phone number connected.
This means that if for instance we have three or more phone numbers connected to one user, we can maximum transfer two of them. This is not a big issue though...
We have ranked the importance of the phone numbers in the order as I presented them above.
What I do in my T-SQL query is to do a ISNULL() and see if the user has "Direct phone" connected, if not I check for the next type and so on.
Now to my problem! Can anyone give me a suggestion of how to write the code for the extraction of the Alternative phone? What I need to do is to check if there is a "Direct phone" connected to the user, if so I should NOT chose that but the next phone number that I find.
View 7 Replies
View Related
May 14, 2008
I'm currently developing an ASP.NET website which is using SQL Server 2005 and I couldn't decide between two table designs and I hope you can give me your opinions
The website is for a school and it'll be used to create tests from questions. The teacher will:
1. Select grade (could be multiple selection)
2. Select class
3. Select subject
The thing is that same question could be used for multiple grades.
Example query: "Get me questions of trigonometry of math from grades 7,8,9"
(Names used instead of ID's to make it more clear)
The first design:
[BigRelationsTable]
ID - QuestionID - GradeID - ClassID - SubjectID
1 - Question123 - Grade7 - Math - Trig
2 - Question123 - Grade8 - Math - Trig
3 - Question123 - Grade9 - Math - Trig
This is a simple design but all of the columns will need indexes because all of them will be used for searching and that makes me think about table performance.
Second design:
[GradeClassRelations]
ID - Grade - Class
1 - 7 - Math
2 - 8 - Math
3 - 9 - Math
[ClassSubjectRelations]
ID - GradeClassRelationsID - SubjectID
1 - GradeClassRelations1 - Trig
2 - GradeClassRelations2 - Trig
3 - GradeClassRelations3 - Trig
[SubjectQuestionRelations]
ID - ClassSubjectRelationsID - QuestionID
1 - ClassSubjectRelations1 - 1
2 - ClassSubjectRelations2 - 1
3 - ClassSubjectRelations3 - 1
This one is more normalised but this time the need of doing multiple joins makes me wonder.
What do you think? Which one should I use? Or if you have any other suggestions I'm all ears
View 2 Replies
View Related
Dec 18, 2006
hi guys,
I have 4 columns and 3 rows. Columns are Name, Age, Gender and Weight. I have values entered for each column. I need to pick the highest value of weight if Name, Age, Gender are same and put that into new table. how can i do that?
View 6 Replies
View Related
Jun 7, 2006
Greetings SSIS friends
I want to implement the following query using SSIS Data flow Source component :
SELECT * FROM someTable WHERE someColumn = 'H'
How do I restrict the data coming from my data source? By that I mean how do I apply the WHERE clause in SSIS?! Should I use a conditional Split component?! but that would mean retrieving all records first then adding the split component (not the most efficient method surely).
Any suggestions would be much appreciated.
View 6 Replies
View Related
Mar 18, 2008
Hi there,
I have created an SSIS package which pushes data from SQL Server (2005) to Oracle (Version 9.2.0.7.0), but having some issues with setting up the connection objects to Oracle.
I have attempted the connection with both the OLE DB Destination connection in SSIS and also with an ODBC connection, but both come up with the same error "ORA-12154: TNS could not resolve service name".
I am using a 32-bit version of SQL Server 2005 and the Oracle DB is 64-bit. Any ideas?
View 7 Replies
View Related
Jan 21, 2008
Hi there,
There's a field with Varchar(5) type which contains both alpha and alpha-numeric data. When sorting based on this field 1001 comes before 101. Is there anyway I can sort it appropriately; is there any collation or something which could be used.
Result of the sort:
1001
101
102
1022
103
Thanks,
LOA
View 7 Replies
View Related
Mar 3, 2008
I want to choose a column dynamically depending on a session variable.
In other words, each customer has a different price level. so I need to choose the column that corresponds to thier price level in thier customer record
Any help is appreciated.
below is my futile attempt
SelectCommand="SELECT cove.CATALOG.ITEM_NO,cove.catalog."& <%#= session("pl") %> & ", cove.CATALOG.DESCRIPTION, cove.CATALOG.DESCRIPTION2, cove.CATALOG.DESCRIPTION3, cove.PRODLINE.DESCRIPTION AS Expr1, cove.CATALOG.GRP, cove.COMPANY.PRL, cove.COMPANY.COMPANY FROM cove.CATALOG INNER JOIN cove.COMPANY ON cove.CATALOG.WEB_STATUS <>'[I]' cove.COMPANY.I LEFT OUTER JOIN cove.PRODLINE ON cove.CATALOG.PRODLINE = cove.PRODLINE.CODE WHERE (cove.COMPANY.COMPANY = @company) AND (cove.CATALOG.GRP <> '[ACC]')">
<SelectParameters>
View 3 Replies
View Related
May 22, 2008
I want this...:
SELECT [DateEntered], [From], [To], [Company], [Catagory], [Client], [Description], [TotalHours] FROM [JcpowersJobs] WHERE ([From] > 5/20/2008 12:00:00 AM) AND ([To] < 5/21/2008 11:59:59 PM)
Obviously this won't work, but can anyone tell me what WOULD work?
View 8 Replies
View Related
Jun 21, 2004
I have to write a large data migration script to move data from one SQL Server database to another. Is there any way to dynamically specify the server and database name? I would like to do something like the following, (but this does not seem to work):
Delete From [@ServerName].[@ImportToDatabase].[MyTable]
Any help appreciated
View 2 Replies
View Related
Mar 22, 2006
Hi,
I'm helping a small company built a new website and intranet in asp.net 2.0 and SQL.
I'm having trouble choosing among vs.net 2005, vwd express, SQL 2005
express or SQL 2005 Developers Edition for the prototype/testing phase.
Any advice? I want to build production-ready versions with easy
migrations to production, but I don't want them to have to spend too
much $$$ while it's just in alpha and being prototyped.
thanks,
Bruce
View 1 Replies
View Related
Dec 12, 2000
I have a job that selects alot of data from one database into another.
Can I choose not to log this operation (doesn't need to be and the log fills up before it's done)
Thanks..
type of code:
Insert into database_1
Select * from database_2
View 1 Replies
View Related
Jun 3, 2004
Hi guys!
I need to create a table always that a new register is add in TABLE_ONE
The name of this new table must by 'TABLE_' + TABLE_ONE.Cod
It will be:
TABLE_1
TABLE_2
TABLE_3
...
I know this code must be in a trigger of insert... but how? I did some tests but didnt work.
Thanks in advance.
View 2 Replies
View Related
Aug 6, 2004
Hello, everyone:
There are some explanations on this topic from books and BOL. Could you offer the real experience? Thanks.
ZYT
View 2 Replies
View Related
Oct 28, 2004
Hi,
I have a table with its ID field set as an Identity column with "seed" and "increment" set to 1. Now, I have rows in there that I don't want to change. I'd like the next addtitions to the table to start at a specific value for their ID columns.
Basically, how can I specify a new starting value for an identity column?
Thanks,
Skip.
View 1 Replies
View Related
Mar 17, 2007
I have visual studio 2005 and I am going to create a web application. Which data source or data provider will I choose when I'm connecting to the database(MS SQL Server)? and how about when I create a windows application? will I use the same thing? tnx
View 9 Replies
View Related
Dec 18, 2007
Hello all I am trying to create a stored procedure that will either give the user a chance to use the wild cards or the IR_Number, or subjLastName (from the RevisedSubjects_Table) or a begin Date and an End Date.
CREATE PROCEDURE [dbo].[AdvSrchWildCardsIR]
(@Enter_IR_Number nvarchar(100))
AS
SET @Enter_IR_Number = REPLACE(@Enter_IR_Number, '*', '%')
SELECT dbo.RevisedSubjects_Table.SubjFirstName, dbo.RevisedSubjects_Table.SubjLastName, dbo.Revised_MainTable.[Violation Type],
dbo.RevisedSubjects_Table.[IR Number], dbo.Revised_MainTable.[I/RDocument], dbo.Revised_MainTable.Date, dbo.Revised_MainTable.Action
FROM dbo.Revised_MainTable INNER JOIN
dbo.RevisedSubjects_Table ON dbo.Revised_MainTable.[IR Number] = dbo.RevisedSubjects_Table.[IR Number]
IF patindex( '*', @Enter_IR_Number) > 0
BEGIN
SET @Enter_IR_Number = replace( @Enter_IR_Number, '*', '%' )
SELECT dbo.RevisedSubjects_Table.SubjFirstName, dbo.RevisedSubjects_Table.SubjLastName, dbo.Revised_MainTable.[Violation Type],
dbo.RevisedSubjects_Table.[IR Number], dbo.Revised_MainTable.[I/RDocument], dbo.Revised_MainTable.Date, dbo.Revised_MainTable.Action
FROM dbo.Revised_MainTable INNER JOIN
dbo.RevisedSubjects_Table ON dbo.Revised_MainTable.[IR Number] = dbo.RevisedSubjects_Table.[IR Number]
END
View 8 Replies
View Related
Sep 19, 2014
How Choose function in SQL is useful in a table. Any example with a simple table and how it can be useful for any particular column in a table
View 1 Replies
View Related
Dec 20, 2006
Hi there
I am up against a condition where my control flow should be divided into threads and depending on value of a variable i have to choose 1 of the threads.
Its something like
if a =1 then execute this
else execute this one.
Thanks and Regards
Rahul Kumar, Software Enggineer
View 3 Replies
View Related
Apr 22, 2008
Hello all,
I got a problem when using Sql Service 2005. I have two parameters @ID and @Name. I want to choose either and only one parameter to generate my report at one time. Could anyone tell me how to do it? I tried the "or" tab after filter tab, but it only generate the report with both @ID and @name values I gave.
Thanks in advance.
View 7 Replies
View Related
Aug 8, 2007
Hi,
I need to be able to get the maximum value of different calculations.
Example :
i have 5 calculations like this :
(sum(Fields!CountTest1.Value)/sum(Fields!TestCount.Value))*100
(sum(Fields!CountTest2.Value)/sum(Fields!TestCount.Value))*100
(sum(Fields!CountTest3.Value)/sum(Fields!TestCount.Value))*100
(sum(Fields!CountTest4.Value)/sum(Fields!TestCount.Value))*100
(sum(Fields!CountTest5.Value)/sum(Fields!TestCount.Value))*100
these calculations give me a percentage from a test value against the total test values.
what function or expression can i use to get the max value of all the calculations ?
I was looking at the "choose" function but i'm not quite sure how...
anybody ? help ....
Vinnie
View 1 Replies
View Related
Jun 28, 2006
I have an ActiveX Script Task in SQL Server 2000. It chooses one of two
possible success-paths depending on if a file exist or not. (Part of the old ActiveX Script for choosing next step is below)
I need to rewrite this for a Script Task in SQL Server 2005 but it seems like it
doesn't have this functionality and objects.
Does anyone know how to write the code for choosing the next step in a
Script Task or knows another way to solve my problem?
The package is not suppose to fail if the file is missing, it's must succeed and that's why I need two success-paths.
Regards,
Sara
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main ()
Dim pkg
Dim stpContinuePkg
Dim stpExit
SET pkg = DTSGlobalVariables.Parent
SET stpContinuePkg = pkg.Steps("DTSStep_DTSActiveScriptTask_4")
SET stpExit = pkg.Steps("DTSStep_DTSActiveScriptTask_21")
If ...... Then
Main = DTSStepScriptResult_ExecuteTask
stpContinuePkg.DisableStep = False
stpExit.DisableStep = True
Else
.......
End If
Main = DTSTaskExecResult_Success
End Function
View 3 Replies
View Related
Nov 23, 2007
Hi there,
How to choose the right RAID level for a database server based on disk performance counters?
Lets say I have the collected performance counters data for Disk Transfers/sec, Disk Writes/sec and Disk Reads/sec.
Or is there any other best method to decide the RAID level?
Please let me know.
Regards,
mkarumuru
View 3 Replies
View Related