|
What is the value of intstatus for the test row? You don't select that, but you do filter on it.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
|
Hi.
I posted this on the C# forum, but probablly this is a better place.
I'm having a little trouble getting this thing to work.
I have two tables Houses and People
Every "Person" belongs to a House, but only one per house is the "OwnerOfHouse".
So I made a colum named "HouseOwner" in the "House" table, which has the PersonID. And every person has a "HouseID_FK" which tells them to which house they belog.
SO here is the thing. I'm working with ADO.NET 2.0, and using BindingSource. So I have a BindingSource that has my Houses in a nice DataGridView, and when I click on any of them, I have another DataGridView which displays the people that live there.
That works Fine.
Now, when I chose one of the inhabitants, and press a button, His ID is updated on the Houses table, and I have a reference that tells me he is the Owner. So far so good.
What I want to do is that when I choose a House in my first DataGridView, The Owner is selected automaticlly in the People DataGridView. So far I've tried everything I could thinf of, but it allways selects the first element (the first person on the list).
Thanks in advance.
|
|
|
|
|
** HELP **
When one wants to version control their stored procedures, they can do this fairly easily through the VS.NET IDE.
As an FYI - If you care - Here is an old sample of how to do this
http://weblogs.asp.net/fmarguerie/archive/2003/02/24/2880.aspx
OK, all is good, now, if one MOVES the VSS database (in this case, to a different server), everything seems to go haywire.
(Using VS .NET 2003, SourceSafe version 6.0d, SQL Server 2000)
The problem seems to be rooted in the fact that there is no place to tell .NET IDE the new location of your srcsafe.ini file!
The FIRST time around, (after some preliminary tasks), in server explorer window, you simply right-click on the "+-Stored Procedures" entry and select "Add To Source Control". A nice dialog comes up and you enter the location of your SS database, and your project name, etc.
All SP's are added to VSS and bam! you are good to go.
When you go here to check in and out, refresh, you are asked for a SourceSafe login, etc.
Now, the VSS database has moved. So, when you try to log in to VSS it fails (just keeps popping up the login dialog until you click cancel). When you right click, Add and Remove from source control are disabled.
I have tried clearing out the database, unchecking and re-checking "Enable Version Control"
in Tools->Options->Database Tools->Server Explorer... nothing works!
Somewhere, the OLD location of this VSS database is being stored and I need to change it.
Any Help?????
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
|
Thanks for the reply "S".
I did search the registry (I looked for srcsafe.ini & part of my VSS db path) nothing found except sone history entries.
The article & tool link you provided is cool, but it will not help. It only removes VSS references from a particular VS solution. The Server Explorer is independent of any solution. I do not have a particular solution that is at issue, it is when I navigate to "Stored Procedures" under my server explorer window.
Thanks again.
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
Hello,
I'm trying to run this code in SQL Server 2005:
DECLARE @UserId int
EXEC User_Insert @UserId = @UserId OUTPUT, @FirstName = N'Luis Alonso', @LastName = N'Ramos',
@PhoneNumber = N'whatever, @Email = whatever', @UserName = N'luisr',
@UserType = 5, @BranchId = NULL, @CreationUserId = 0, @CreationDate = N'31/01/2006'
EXEC User_SetPassword @UserId = @UserId, @PasswordHash = N'356A192B7913B04C54574D18C28D46E6395428AB' and I'm getting this error:
Msg 8114, Level 16, State 1, Procedure User_Insert, Line 0<br />
Error converting data type nvarchar to datetime.
The problem is with the last parameter, CreationDate . I don't know how to pass a literal date value (it works fine when called from code using parameterized queries.) If I use SQL Management Studio to generate the query for me, it's generated as above, and it won't work.
Even using @CreationDate = GETDATE() won't work, but with a different error.
Ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
-- modified at 13:37 Tuesday 31st January, 2006
|
|
|
|
|
Try this.
<br />
DECLARE @UserId int<br />
DECLARE @dtNow DateTime<br />
Set @dtNow = GetDate()<br />
<br />
EXEC User_Insert @UserId = @UserId OUTPUT, @FirstName = N'Luis Alonso', @LastName = N'Ramos', @PhoneNumber = N'whatever, @Email = whatever', @UserName = N'luisr', @UserType = 5, @BranchId = NULL, @CreationUserId = 0, @CreationDate = @dtNow<br />
<br />
EXEC User_SetPassword @UserId = @UserId, @PasswordHash = N'356A192B7913B04C54574D18C28D46E6395428AB'<br />
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
Hi,
I have an c++application where the user enters the value of a"primary key" in a
Table via embedded sql. Is there a way of checking if the key already exists in the table. Thus I could show a message in the application to user that the value already exists. There for he would have to enter another one ?
Foxpro or mySql
Gerry
|
|
|
|
|
Hi,
1. How Can I transfer data stored on SQL 2000 with Operating System windows 2003 Advance Server to my PDA.
2. How can I get email with attachment (excel sheet)on my PDA.
|
|
|
|
|
Hi I am having trouble trying to figure out this sql query I need to display the opponents for a soccer team and display whether or not the team was at home or not at the moment I can display the two teams involved in the match and the stats I need but I don’t how to always get the other teams and display whether or not they were at home. This is my current query any help would be appreciated
Select homeClub.Name + ' v ' + awayClub.Name as Match, pz.DistanceCovered From Teams t
Join Person p on p.ID = t.PlayerID Join PZData pz on pz.TeamID = t.TeamID Join Match m on m.Id = t.MatchId
JOIN Squad homeSquad on m.SquadA = homeSquad.[ID]
JOIN Squad awaySquad on m.SquadB = awaySquad.[ID]
JOIN Club homeClub on homeSquad.ClubID = homeClub.[ID]
JOIN Club awayClub on awaySquad.ClubID = awayClub.[ID]
where t.ClubId in (select ClubID from Squad Where ID = 5)
and p.Id = 19
order by m.date asc
|
|
|
|
|
The only way you could get help with your problem is to list the following info:
1) A sample layout of a query result desired.
2) A list of the columns available in each of the tables.
Without this information we would only be guessing.
|
|
|
|
|
How to use session varibale using ASP?m Trying to create Secure webpages.But when user clicks on File->Send_>pgae as Email Attahcment,then pages go through but seession will not expir pls help me
regards
sumit
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
|
|
|
|
hi
I copied this sql query from msdn I am getting the following
Must declare the variable '@TheYear'
If i declare the value for the variable @TheYear I am getting the same error .Whats the matter with query any idea the query is below
SELECT o.customerid, od.orderid, SUM(od.quantity*od.unitprice) AS price
FROM Orders o, [Order Details] od
WHERE Year(o.orderdate) = @TheYear AND od.orderid=o.orderid
GROUP BY o.customerid, od.orderid
ORDER BY o.customerid
DECLARE @TheYear int
SET @TheYear = 1998
SELECT
CASE GROUPING(o.customerid) WHEN 0
THEN o.customerid ELSE '(Total)' END AS MyCustomerID,
CASE GROUPING(od.orderid) WHEN 0
THEN od.orderid ELSE -1 END AS MyOrderID,
SUM(od.quantity*od.unitprice) AS price
FROM Orders o, [Order Details] od
WHERE Year(orderdate) = @TheYear AND od.orderid=o.orderid
GROUP BY o.customerid, od.orderid WITH ROLLUP
ORDER BY o.customerid, price
sasi
|
|
|
|
|
Hello
sasire18 wrote: SELECT o.customerid, od.orderid, SUM(od.quantity*od.unitprice) AS price
FROM Orders o, [Order Details] od
WHERE Year(o.orderdate) = @TheYear AND od.orderid=o.orderid
GROUP BY o.customerid, od.orderid
ORDER BY o.customerid
DECLARE @TheYear int
SET @TheYear = 1998
you have to declare "@TheYear" before the query but you declared it after the query.
Pankaj Kulkarni
|
|
|
|
|
DECLARE @TheYear INT
SELECT o.customerid,
od.orderid,
SUM(od.quantity*od.unitprice) AS price
FROM Orders o, [Order Details] od
WHERE Year(o.orderdate) = @TheYear
AND od.orderid=o.orderid
GROUP BY o.customerid, od.orderid
ORDER BY o.customerid
SET @TheYear = 1998
SELECT CASE GROUPING(o.customerid) WHEN 0 THEN o.customerid ELSE '(Total)' END AS MyCustomerID,
CASE GROUPING(od.orderid) WHEN 0 THEN od.orderid ELSE -1 END AS MyOrderID,
SUM(od.quantity*od.unitprice) AS price
FROM Orders o, [Order Details] od
WHERE Year(orderdate) = @TheYear
AND od.orderid=o.orderid
GROUP BY o.customerid, od.orderid WITH ROLLUP
ORDER BY o.customerid, price
check now. it will work.
|
|
|
|
|
No. It won't.
You declare @TheYear, use @TheYear, and then SET @TheYear. What is the value of @TheYear in the first SELECT statement.
As the question was already answered correctly, I'm left wondering why you also answered.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I actually got my answer from Pankaj
sasi
|
|
|
|
|
I've updated a connectionString manually on IIS and restarted Web site,
but previously working INSERT is not working to the new data source.
New connectionString is okay (see details below).
I know I can have multiple connectionStrings, but don't know
how to select one of them on the fly.
I don't know how to handle this situation.
Any help will be very appreciated.
Thanks in advance!
Eugenio
DETAILS:
I'm running an ASP.NET Web Service (IIS 5.1).
Web service INSERTs a couple of records successfully into a DataSet
created using DataSet Wizard on VS2005 to a SQLEXPRESS on local machine.
I've the same database on a remote SQLSERVER (that I can access thru
MS SQLServer Mgmt Studio Express), and wanna INSERT data to it.
So I manually changed Web.config to the new connectionString on IIS and
restarted the Web site that I'm using. Data obviously did not go to the
old database, but it did not go to the new too! (although my code haven't
thrown any exception). Data has been lost.
Second turn, I configured the code to use an ODBC System DSN to the
old and okay database. Worked fine. Changed the DSN settings to the
remote database (connectionString remained the same) as restarted
Web site on ISS. The same behaviour got before: data was lost!
Eugenio
|
|
|
|
|
Hi everybody!
I've got a problem: (C# 2005)
I'm writing an applitcation that menage a database. I want to use the timestamp method to make the update to the database. I've alreay added to each relation in my database a column with a timestamp value. I know i must modify the text of the update command in the table adapter but i dont know how...
please help me!
thank you in advance
Enrico
VentoEngine corp.
Program your life ^^
|
|
|
|
|
I'm using ADO to connect via ODBC. Somehow there are two connections being opened at the database server. At first I thought that the problem was connection pooling. After reading many articles from MSDN and others I have tried the solutions to no avail.
I have read that to turn off connection pooling in .NET you use Pooling=False in the connection string. In VB6 you use OLE DB Services=-4. I have also read of other folks using OLE DB Services=-2.
Our DB2 database vendor supplied us with Hummingbird BI-Query. (A modeling, query, reporting tool application). This app does not have the connection problems I am having. I contacted hummingbird for some help with the connection string. They had a trace log but that did not reveal the connection string.
When I step through the code there are 2 connections opened on the cn.Open method. When the cn.Close method is executed only one of the connections is closed. In .NET I have tried to force garbadge collection. This has not worked. However, when the .NET app closes the connection closes. The VB6 app does not do this.
As a test in in VB.NET very simply I do:
<br />
Dim cn As OdbcConnection<br />
<br />
cn = New OdbcConnection<br />
<br />
cn.ConnectionString = "DSN=MyDSN" _<br />
& "; uid=MyUID; pwd=MyPwd; Pooling=False"<br />
<br />
cn.Open()<br />
cn.Close()<br />
In VB6 very simply I do:
<br />
Dim cn As ADODB.Connection<br />
<br />
Set cn = New ADODB.Connection<br />
<br />
cn.ConnectionString = "DSN=MyDSN" _<br />
& "; uid=MyUID; pwd=MyPwd;OLE DB Services=-2"<br />
<br />
cn.Open<br />
cn.Close<br />
<br />
set cn = Nothing<br />
<br />
Thanks for your help,
Steve
|
|
|
|
|
We developed an asp .net application that connects to a sql database. To go live with the application we need to move the sql database to another server. How can this be done?
|
|
|
|
|
Two ways I can think of.
1. Detach the database move the files and then attach at the other end. (You'll then have to wire up the logins again as the login ids will be different because they are stored in the master db)
2. Create a backup of the database, move the backup file to the new system, then restore the backup (you'll again have to wire up the logins to accounts for the same reasons given above).
Personally, I'd go with the second option. I've had problems with the first option when it is being attached again and SQL Server declaring it as "suspicious". The second is also easier as the backup will place everything in one (very large) file, while the detach/attach will require you to move all the files.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Colin Angus Mackay wrote:
(You'll then have to wire up the logins again as the login ids will be different because they are stored in the master db)
what does it mean?? i mean how can this b done??
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
|