I added something by mistake! If I delete it it gives me an `are you sure?` message that makes me think it'll actually delete the file from the hard drive. As I've accidentally added something from SQL Server (I was trying to add a database and got carried away) I don't think that's such a good idea. I've googled and found this:
http://msdn2.microsoft.com/en-us/library/1ee8zw5t(VS.80).aspx
which helpfully states:
----- To remove a solution item
In Solution Explorer, select the item you want to remove.
On the Edit menu, choose Remove.
-----
which would be great, if only the Edit menu had a remove option.
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.
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.
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
VB.NET 2005 Express and SQL Server 2005 Express - NOT saving updates to DB - SOLUTION!
-----------------------------------
The following article is bogus and confusing:
How to: Manage Local Data Files - Setting 'Copy to Output Directory' to 'Do not copy' http://msdn2.microsoft.com/en-us/library/ms246989.aspx
You must manually copy the database file to the output directory AFTER setting 'Copy to Output Directory' to 'Do not copy'.
Do not copy
The file is never copied or overwritten by the project system. Because your application creates a dynamic connection string that points to the database file in the output directory, this setting only works for local database files when you manually copy the file yourself.
You must manually copy the database file to the output directory AFTER setting 'Copy to Output Directory' to 'Do not copy'.
-----------------------------------
The above article is bogus and confusing.
This is rediculous!
This is the most vague and convoluted bunch of nonsince I've ever come accross!
Getting caught out on this issue for the 10th time! And not being able to find an exact step-by-step solution.
--------------------------
I've tried it and it doesn't work for me.
Please don't try what the article eludes to as I'm still sorting out exactly what is supposed to be happening.
If you have a step-by-step procedure that can be reproduced this properly please PM me.
I would like to test its validity then update this exact post as a solution rather than just another dicussion thread.
Many thanks.
This is the exact procedure I have come up with:
NOTE 1: DO NOT allow VB.net to copy the database into its folders/directorys.
NOTE 2: DO NOT hand copy the database to a folder/directory in your project.
Yes, I know its hard not to do it because you want your project nice and tidy. I just simply could NOT get it to work. You should NOT have myData.mdf listed in the Solution Explorer. Ever.
Create a folder for your data following NOTE 2.
Copy your data to that folder. * mine was C:mydatamyData.mdf
Create a NEW project.
Remove any Data Connections. ( no matter what)
Save it.
Data | View Data Sources
Add New Data Source
select NEW CONNECTION ( No Matter what, do it!
Select the database. * again mine was C:mydatamyData.mdf
Answer NO to the question: Would you like to copy the file to your project and modify the connection? - NO ( no matter what - ANSWER NO ! - Absolutely NO ) Then select the tables you want in the DataSet. and Finish.
To Test ----------
From the Solution Explorer | click the table name drop down arrow | select details Now Drag the table name onto the form.
The form is then populated with a Navigation control and matching Labels with corresponding Textboxes for each field in the table.
Save it.
1) Run the app.
Add one database record to the database by pressing the Add(+) icon
Just add some quick junk data that you don't mind getting lost if it doesn't save.
YOU MUST CLICK THE SAVE ICON to save the data you just entered.
Now exit the application.
2) Run the app again.
And verify there is one record already there.
Now add a second database record to the database by pressing the Add (+) icon.
NOW add some quick junk data that you WILL intentionally loose.
*** DO NOT *** press the save icon.
Just Exit the app.
3) Again, Run the app.
Verify that the first record is still there.
Verify that the Second record is NOT there. Its NOT there because you didn't save the data before exiting the app.
Proving that YOU MUST CLICK THE SAVE ICON to save the data you just entered.
Also proving you must add your own code to catch the changes and ask the user to save the data before exitiing or moving to another record.
As a side note, since vb.net uses detached datasets, (a copy/snapshot of the dataset in memory and NOT directly linked to the database) the dataset will reflect all changes made when moving around the detached datasets. YOU MUT REMEMBER TO SUBMIT YOUR CHANGES TO THE DATABASE TO SAVE THEM. Otherwise, they will simply be discarded without notice.
Whewh!
I hope this saves me some time the next time I want to start a new database project.
Oh, and uh, for anyone else reading this post.
Thanks, Barry G. Sumpter
Currently working with: Visual Basic 2005 Express SQL Server 2005 Express
Developing Windows Forms with 101 Samples for Visual Basic 2005 using the DataGridView thru code and every development wizard I can find within vb.net unless otherwise individually stated within a thread.
I tried to remove AdventureWorksDB in the "Add or Remove Programs" of Contol Panel and I got the following errors: (1) AdventureWorksDB Error 1326: Error getting file security: CProgram FilesMicrosoft SQL ServerMSSQL1MSSQLGetLastError: 5. |OK| and (2) Add or Remove Programs Fatal Error during installation (after I clicked the |OK| button). Please help and tell me how I can solve this problem.
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.
I have uninstalled the CTP version of the SQL Server express so that I can install the released version but CTP version is still listed in the add/remove program list but without the change/remove button. I have been to different sites to find information on cleaning this up and I have ran all the uninstall tool I can find but the problem still prevails. I cannot install the released version without completely getting rid of the CTP version. Please help anyone.
I am having a hard time removing my SQL instance inside the Add/Remove program. After i select the SQL Instance name and then I tried to remove it but it won't allow me to delete it. There isn't any error message or whatsoever. Actually, when i try to log it in my SQL Management studio, that certain sql instance name is not existing according to the message box. Is there any way to remove the Sql Instance in my system?
But I still don´t know how to call the equipment table and get champion name and item names for the numbers. What did I do wrong and how can I fix it?
Not 100% sure how to do this so I would appreciate some directions. I have 2 tables, Systems and Contacts. A system can have 1 to infinite contacts and contact can have 1 to infinite systems. So I use a 3rd table Sys_Con to add the contact needed for each system. Now my question is once I add the System and contact how do I know for sure which ContactID to add in my Sys_Con table? Because while I am doing this operation maybe someone can add an other contact. So is there a way for my store proc Add_Contact to return the contactID needed for my store proc Add_Sys_Con ?
TABLE Sys_Con SystemID int ContactID int
Table Contact ContactID int Identity ContactName ...
What I would like to have is only ONE (1) row PER member with only the FIRST (not max!) entered known data. In the above case, I'd like to have this as result:
How can I get the value of the last Item in a coums?SELECT COLUMN FROM DATABASE ORDER BY COLUMN DESC?something with Fields(0).value?Thank you in advance
I have sql server 2000 that was working fine until today(figures), today I opened EM and under sql server group where used to be all my information now there is NO ITEM, nothing shows(database,Nothing) The server is working as I had no complaints from my user on data not been saved or getting data from but its strange that I can not see all my info like I used to.- If I go into sql query analizer, it ask me to connect to local which I do and I can see all my databases from there but once I close that window ,on my EM nothing shows.
I checked all services andevery one of them seems to be up and runnig
Hi Every Body, I have one table it's called -Access.It contains two columns name of that is Door,Emp_Id. example Door Emp_Id 10 1 10 2 10 3 11 4 12 5 11 1 this is the value in that table....... I want get Which Door number maximum Access from the table..... Thanks & Regards, S.Sajan
Hi Everyone I have an ADP and I need to create a report that will give me the total number of each item. I need the report to show how many [Violation Type], and the total [Loss] per violation. Can anyone help please
I have some problem about parameter to query data. My parameter is available from dataset but it doen not have blank or null value. So when I want to select this...
SELECT * FROM mytable WHERE (@param_person_id IS NULL OR @param_person_id = person_id)
cannot success. This statement means "if @param_person_id has null value, this statement is select every person_id. On the other way, if @param_person_id is not null value, this statement select only specific person_id".
So I want to add blank or null value to my dataset for working with select statement.
Hi,I want to check that Is there row exists in table or not.Please correct me. Dim conn As SqlConnection Dim comm As SqlCommand Dim reader As SqlDataReader Dim connstring As String connstring = ConfigurationManager.ConnectionStrings("iharyana").ConnectionString conn = New SqlConnection(connstring) comm = New SqlCommand("select * from test where username=@username", conn) comm.Parameters.Add("@username", Data.SqlDbType.VarChar, 20) comm.Parameters("@username").Value = uname conn.Open() reader = comm.ExecuteReader While reader.Read If reader.Item("username").ToString = "" Then Response.Redirect("http://www.iharyana.com") End If End While reader.Close() conn.Close()
just wondering which command I can use to query items status ? in my TABLEA Product(D | Name | Type | Status 1 Apple Fruit 00021234 2 Banana Fruit 00031244 3 Tube Clothe 00012131 4 Tee Clothe 00041111 4 pants Clothe 00041112 4 tank Clothe 00051111 4 Jeans Clothe 00061111 4 Dress Clothe 00051111
in TABLEB ID StatusID Status 1 0001 A 2 0002 B 3 0003 C 4 0004 D 5 0005 E 6 0006 F use this record as a example : ProductID | Name | Type | Status 1 Apple Fruit 00021234
use TableA.Status reference to TableB.StatusID ( compare 0001 , need not to care about the last 4 numbers ) so the status is A
AB is Group 1 C is Group 2 DEF is Group 3 in my TABLEA Product(D | Name | Type | Status 1 Apple Fruit 00021234 2 Banana Fruit 00031244 3 Tube Clothe 00012131 4 Tee Clothe 00041111 4 pants Clothe 00041112 4 tank Clothe 00051111 4 Jeans Clothe 00061111 4 Dress Clothe 00051111
I want the result looks as follow TYPE Group 1 Group 2 Group 3 Fruit 1 1 0 //because Apple Fruit 00021234 → 0002 = B → Group 1 And Banana Fruit 00031244 →0003 =C→Group 2 Clothe 1 0 5
I need to run a query to get the result like that , and then put the result to my DataGrid then show to user... can I just use SQL Query to get the result? I just try to use like sum�Substring ... trying to get the result but I still can't wirte a query to work for this question.. which command I should use for this question? or it must be done in code-behind ? can you please give me help? thank you very much
If you browse to Amazon and drill down through categories until a paged listing appears, you will see in each item of the listing that the description rendered as Book Description, is a cutdown version of the full description, with a ... and "Read More" hyperlink. How is this achieved programatically? I dont know if thre is an efficient way in SQL Server to do this, or whether it would be easier to have a ShortHand field and a Description field, both of which are teh full description when shown in the Details page, but the ShortHand is the field rendered in listings. This seems like a simplistic solution and I am thinking there may be programmatic means of doing the same - has anybody got any experience in this area?
I have a table with Bill_Doc, Bill_Item and Bill_Doc_Count fields. I need to update Bill_Doc_Count with 1 only on the first Bill_Item. Is this possible? I tried min and max but they don't work for me.
I have a sql table containing names of departments. Is there a way after a user has typed a department in a textbox on a web page I can search for it in the sql table and if it isn't there then add it. I am using asp.net for the web page.
Hiya,I want to populate a list view (in a variety of ways), but I would rathernot execute my function once for every record I want to show in the list.What I want to do is pass an array of "keys" into a stored procedure andhave that procedure return one recordset with all of the records in. Sowhat I want to do is something like:CREATE PROCEDURE MySuperProcedure@MyArrayOfIDs (some way of specifying an array of integers),ASSELECT *FROM MyTableWHERE MyArrayOfIDs.ContainsTheInteger ( MyTable.ID )Obviously this syntax is not available. Is there another way of doing this?
I am using SQL Server 2005 Reporting Services. Right now, I have a textbox with 0 or 1 values in my report and I want to show a checkbox: checked for value 1 and uncheck for 0. Is there anyway to add a checkbox in the report?
I have included the create table statements, sample data and a stored procedure.
I have a stored procedure that walks the associations so that I can assemble all the nodes of the tree. I think this is working properly.
I have two requests/needs/problems that I need to solve: (1) I want to create a NEW stored procedure that takes a WhoID and an AssocID. This new stored procedure would show the shortest or closest path between WhoID and AssocID.
For example, if I pass in 6,1 to this new proc I want the stored procedure to return the hierarchy with the closest path between them. Based on the sample data below, the path would be 6 - 8 8 - 2 2 - 3 3 - 1
(2) I might also need a proc that accepts two inputs (again, lets use 6,1) but would show all paths / branches of the tree where person 1 exists. Based on the stored procedure procCTE_Assoc 6, this solution would exclude the "fred and jeff" node but would include the other two nodes because person 1 is within the other two nodes.
Please provide your suggestions, comments, or solutions!
CREATE TABLE dbo.Who( WhoID bigint IDENTITY(1,1) NOT NULL, FName varchar(50) NOT NULL ) GO CREATE TABLE dbo.Assoc( WhoID bigint NOT NULL, AssocID bigint NOT NULL ) ON PRIMARY
SET IDENTITY_INSERT dbo.Who ON GO INSERT INTO Who (WhoID,FName) VALUES (1,'user1') INSERT INTO Who (WhoID,FName) VALUES (2,'user2') INSERT INTO Who (WhoID,FName) VALUES (3,'admin1') INSERT INTO Who (WhoID,FName) VALUES (4,'admin2') INSERT INTO Who (WhoID,FName) VALUES (5,'admin3') INSERT INTO Who (WhoID,FName) VALUES (6,'Keith') INSERT INTO Who (WhoID,FName) VALUES (7,'fred') INSERT INTO Who (WhoID,FName) VALUES (8,'Joe') INSERT INTO Who (WhoID,FName) VALUES (9,'Jack') INSERT INTO Who (WhoID,FName) VALUES (10,'Doug') INSERT INTO Who (WhoID,FName) VALUES (11,'Mark') INSERT INTO Who (WhoID,FName) VALUES (12,'Al') INSERT INTO Who (WhoID,FName) VALUES (13,'Jeff') INSERT INTO Who (WhoID,FName) VALUES (14,'Brandon') INSERT INTO Who (WhoID,FName) VALUES (15,'Ashley') INSERT INTO Who (WhoID,FName) VALUES (16,'Lisa') INSERT INTO Who (WhoID,FName) VALUES (17,'Julie') INSERT INTO Who (WhoID,FName) VALUES (18,'Brian') go SET IDENTITY_INSERT dbo.Who OFF GO INSERT INTO Assoc (WhoID,AssocID) VALUES (1,4) INSERT INTO Assoc (WhoID,AssocID) VALUES (2,1) INSERT INTO Assoc (WhoID,AssocID) VALUES (2,3) INSERT INTO Assoc (WhoID,AssocID) VALUES (6,7) INSERT INTO Assoc (WhoID,AssocID) VALUES (6,8) INSERT INTO Assoc (WhoID,AssocID) VALUES (7,13) INSERT INTO Assoc (WhoID,AssocID) VALUES (8,2) INSERT INTO Assoc (WhoID,AssocID) VALUES (14,8) INSERT INTO Assoc (WhoID,AssocID) VALUES (6,15) INSERT INTO Assoc (WhoID,AssocID) VALUES (15,18) INSERT INTO Assoc (WhoID,AssocID) VALUES (15,17) INSERT INTO Assoc (WhoID,AssocID) VALUES (17,5) INSERT INTO Assoc (WhoID,AssocID) VALUES (5,1)
go create proc dbo.procCTE_Assoc @WhoID bigint AS
WITH GroupsCTE (WhoID, AssocID, FName, FNameAssoc, Lvl, Sort, GroupWithIndent) AS ( -- Anchor Who definition SELECT M.WhoID, MA.AssocID, M.FName, AssocWho.FName, 0 AS Lvl, CONVERT(varchar(2000),AssocWho.FName) AS Sort, CONVERT(varchar(255), AssocWho.FName) FROM Who M INNER JOIN Assoc MA ON M.WhoID = MA.WhoID INNER JOIN Who AssocWho ON AssocWho.WhoID = MA.AssocID WHERE M.WhoID = @WhoID UNION ALL -- Recursive Who definition SELECT g1.WhoID, MA1.AssocID, g1.FName, g2.FName, Lvl + 1, CONVERT(varchar(2000),RTRIM(Sort) + '|' + g2.FName), CONVERT(varchar(255), REPLICATE ('| ' , Lvl+1) + g2.FName) FROM Who g1 INNER JOIN Assoc MA1 ON g1.WhoID = MA1.WhoID INNER JOIN Who g2 ON g2.WhoID = MA1.AssocID INNER JOIN GroupsCTE CTE ON MA1.WhoID = CTE.AssocID )
I have a table of 30,000 records on my handheld which runs windows 4.2 and sql me. When the item I am searching for is at the top of the table, the search finds it easily. When the item is in the middle or lower, it doesnt find it. I am not running out of memory and my database is on the local memory. Here is my code:
String query = "SELECT * FROM Products WHERE Barcode = " + TheReaderData.Text;