|
Hello everyone,
I'm looking at building an N-Tier application in .NET and and i'm looking for samples, books or tutorials to get my skills up to scratch. So far the best article i've found is this from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/buildntierapp.asp[^]
has anyone else more experienced in N-Tier applications read this and has any comments or suggestions on the document?
Also, if anyone knows a good book on the topic or any other websites please post and let me know
Thanks
|
|
|
|
|
hi
I have made an stored procedure but it is not saving records. Can any one point out error in it.
<br />
CREATE PROCEDURE [update__FData]<br />
(@UName [nvarchar],<br />
@FName [nvarchar],<br />
@Given [bigint],<br />
@Pressed [bigint])<br />
<br />
AS UPDATE [TypingTutorDB].[dbo].[_FData] <br />
<br />
SET [Given] = @Given,<br />
[Pressed] = @Pressed <br />
<br />
WHERE <br />
( [UName] = @UName AND<br />
[FName] = @FName)<br />
<br />
GO<br />
Thanks
Syed Shahid Hussain
|
|
|
|
|
Sometimes when I have this problem, it is because I've been sleeping when I created the procedure, and created it in the wrong database. This error usually happens late at night.
Have you been sleeping?
Best regards,
Soeren
|
|
|
|
|
Bad Robot wrote: Sometimes when I have this problem, it is because I've been sleeping when I created the procedure, and created it in the wrong database.
I think most of us have been there at one time or another. My time is usually first thing on a monday morning when I wonder why none of my tables exist in the "master" database, only to realise 5 minutes later that I forgot to switch to the correct database.
|
|
|
|
|
Exactly, same here - I love to peek over people's shoulders to see if they are also doing this - and 4/10 they do it!!!
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
|
The problem is your parameter data types. You have to set a length for nvarchars.
ex: @UName nvarchar(50)
|
|
|
|
|
You don't use a stored procedure like a table. You execute it rather than select from it. the stored procedure itself may return some records (but doesn't have to, some only create or modify data or structure), but the SP is not itself a valid target for the 'FROM' clause of a select statement.
Your SQL is not valid in ay case, as only one FROM would be expected (possibly multiple tables after the "From" )
You're trying to select results from combinations of results...that won't work.
|
|
|
|
|
I want to change following sql statement to using inner join but I dont know how to join on two column on the two table. Thanks for helping.
select *
from Persons A, Banks B
where B.Student_ID = A.Student_ID
AND B.class_NO = A.claa_NO
when I change to the following statement, I get an error on the syntax. Incorrect syntax near the keyword 'ON'.
select *
from Persons A
INNER JOIN B
ON B.Student_ID = A.Student_ID
ON B.class_NO = A.claa_NO
Please kindly help. Thanks
|
|
|
|
|
Try
SELECT *
FROM PERSONS A
INNER JOIN BANK B
ON B.STUDENT_ID = A.STUDENT_ID
AND B.CLASS_NO = A.CLASS_NO
|
|
|
|
|
It works!!! Thank you very much
|
|
|
|
|
You are not defining B as an alias.
|
|
|
|
|
Hi I am having a problem returning a value from a stored procedure...It keeps returning Nothing...here is the stored procedure:
'===============================================
ALTER PROCEDURE dbo.spAddUser(@Name VARCHAR(50),
@LoginName VARCHAR(50),
@LoginPass VARCHAR(50),
@SecLvl INT)
AS
SET NOCOUNT ON
INSERT INTO dbo.tblUser([Name],
LoginName,
LoginPass,
SecLvl)
VALUES(@Name,
@LoginName,
@LoginPass,
@SecLvl)
RETURN @@IDENTITY
'===============================================
And here is the code I am using to call it:
'===============================================
Public Shared Function ExecuteScalarStoredProc(ByVal conStr As String, ByVal procName As String, ByVal procParams As String) As Object
Dim ret As Object
With New SqlClient.SqlConnection(conStr).CreateCommand
.CommandText = "EXEC " & procName & " " & procParams
.Connection.Open()
ret = .ExecuteScalar
.Connection.Close()
End With
Return ret
End Function
'===============================================
Any sugestions?
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
hi there
well I'm not the greatest in these things but I think the problem lies with ur procedure bcz u dont return values from it... I think u should use OUTPUT parameters in this. then atthe time u call the procedure u dont provide any value for those but u receive the value from it after the stored proc is called. u need to chg the definition of ur stored proc and declare an output variable @Identity as
@Identity INT OUT[PUT]
and in the end dont use RETURN use set @Identity = @@Identity
Go ahead and try it out, I'm sure it'll solve ur problem though but do let me know
Imran Akram.
|
|
|
|
|
Thanks...this is what I ended up doing to get it to work:
ALTER PROCEDURE dbo.spAddUser(@Name VARCHAR(50),
@LoginName VARCHAR(50),
@LoginPass VARCHAR(50),
@SecLvl INT)
AS
SET NOCOUNT ON
INSERT INTO dbo.tblUser([Name],
LoginName,
LoginPass,
SecLvl)
VALUES(@Name,
@LoginName,
@LoginPass,
@SecLvl)
SELECT IDENT_CURRENT('tblUser')
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
|
I think my brain fell on the flore for a few minutes LOL, thanks for the help!
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
I want to do a query by Select Statement on date BUT
the problem that I want to make this query at 5 days before the date in the table.
For Ex,
I have date 6-1-2006 {with format(dd-MM-yyyy)} THEN,
I want when the query works give me a message before 5 days from this date, THAT MEANS
the query will give me the message at 1-1-2006.
I realy wanna do that,
and maney thanks for help...........
soly
|
|
|
|
|
well I dontknow exactly what ur trying to do but
think abt using this
now()// the function for todays date
if now()+5 = <the date="" from="" database="">print (or whatever) "hi there"
|
|
|
|
|
If you tell us what this is being used for then it might help with the answer. I can think of 2 or 3 ways, but they all have limitations which are acceptable in different scenarios.
|
|
|
|
|
Good day everyone,
I need to update a record into the database Access via table adapter in VB.Net 2005.
The dataset is updated, but the record in the database Access is not.
Could anyone know how to fix this problem?
Please help.I'd appreciate it so much.
Thanks
(Student_Details:table name)
MyDataSet.Student_Details.Rows(2).Item(3) = "new password"
MyDataSet.GetChanges(DataRowState.Modified)
Student_DetailsTableAdapter1.Update(MyDataSet)
MyDataSet.AcceptChanges()
Me.Validate()
Me.Student_DetailsBindingSource.EndEdit()
Me.Student_DetailsTableAdapter1.Update(Me.MyDataSet.Student_Details)
-- modified at 11:11 Saturday 14th October, 2006
eric
|
|
|
|
|
i have DB record named details and excel sheetwhich contains various column(water press,sensitiv press,etc)with values(float with various decimal length..1.12,1.123,1.1232...) that should not be changed as they r standards
.i tried to transform using data transform ,when i transformed the values got added or rounded off as i mentioned float datatype...so how to transform datas
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
Hi,
does anybody knows how to gather the tables and columns of tables in oracle database by SQL Query?
in MySQL, I can gather that informations just to pass a SQL query like "show tables" and get the list of the tables in the certain database as a result.
or I can pass a Query "show databases" and as a result, I get the list of the databases.
but how can I do it in oracle system?
cheers...
|
|
|
|
|
u can try out
select * from tab;
rahul
|
|
|
|
|
thanks, it works!!
maybe you know also how to get the name of the columns in the table?
i try with "describe" command, but seems that oracle doesn't work the way like the MySQL
cheers...
|
|
|
|