Well I made a bussiness object for registering users as well as logging them in. I dont know if my bussiness obect is screwed up or if its the database, or the SQL syntax or what. Please take a look at this. I am not getting any error messages, but nothing is being added to the server. I am using MSDE for the SQL Server.
Here's my bussiness object:
Imports System
Imports System.Data
imports System.Data.oledb
NameSpace LoveShare
Public Class UserDetails
public UserID AS Integer
public FirstName AS String
public LastName AS String
public UserName AS string
public Password AS String
public Address AS String
public City AS String
public State AS String
public Zip As Integer
public Email AS String
End Class
Public Class User
Private objConn As New oledbConnection("Provider=sqloledb;Data Source=GARAGESALELOVESHARE;Initial Catalog=LoveShare1;User Id=sa;Password=notonthispost;")
Public function Login(strUsername AS String, strPassword As String) As Integer
dim intID as integer
dim objparam AS new oledbparameter
dim objcmd AS oledbCommand
objCmd = new oledbCommand("dbo.SPLoginUser", objconn)
objcmd.commandtype = commandtype.Storedprocedure
objparam = New oledbparameter("@UserName", oledbtype.Char)
objParam.Value = strUserName
objCmd.Parameters.Add(objParam)
objParam = New oledbParameter("@Password", OleDbType.Char)
objParam.Value = strPassword
objCmd.Parameters.Add(ObjParam)
Try
objConn.Open
intID = CType(objCmd.ExecuteScalar, Integer)
objConn.Close
Catch e As Exception
Throw e
End Try
If intID.toString = "" Then
return 0
End if
Return intID
end function
Public Sub AddUser(objUser As UserDetails)
Dim intId as integer
Dim objReader As oledbdataReader
Dim objCmdID As New oledbCommand("SELECT MAX(userID) FROM tblUsers", objconn)
Dim objcmd AS New oleDBCommand("spAddUser", objConn)
Dim objparam AS OleDbParameter
objCmd.CommandType = CommandType.StoredProcedure
objParam = New oleDbParameter("@FirstName", oledbtype.Char)
objParam.value = objuser.FirstName
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@LastName", oledbtype.Char)
objParam.value = objuser.LastName
objCmd.Parameters.add(objParam)
objParam = new oleDbParameter("@UserName", oledbtype.Char)
objParam.Value = objUser.UserName
objCmd.Parameters.Add(objParam)
objParam = New oleDbParameter("@Password", oledbtype.Char)
objParam.value = objuser.Password
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@Email", oledbtype.Char)
objParam.value = objuser.Email
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@Address", oledbtype.Char)
objParam.value = objuser.Address
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@City", oledbtype.Char)
objParam.value = objuser.City
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@State", oledbtype.Char)
objParam.value = objuser.State
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@Zip", oledbtype.Integer)
<asp:requiredfieldValidator runat="server" Controltovalidate="tbFirstName" ErrorMessage="First Name Required" Text="Forgot First Name" Display="Dynamic"/>
<asp:requiredfieldValidator runat="server" Controltovalidate="tbLastName" ErrorMessage="Last Name Required" Text="Forgot Last Name" Display="Dynamic"/>
hi all.. hope u guys can help me out here..... 'm new to .net so hope to get all the basic infomr that would b required...
'm on a proj..basically a data mining proj... 'm using sql 2005 enterprise edn's analysis services to perform my data minning tasks... here is what i'd like to know.... i've been following the sql online tutorial book... n as per the tutorial on data minning...i have created a data source ... based on the decision tree algorithm i have even obtained some results.. now.....here is the problem..
i'd like to know if i can actually get all these obtained patterns onto a webpage... i mean can i actually use asp.net n achieve this task of migrating the patterns generated at the bids to a webpage??
please guys if i can do so...then do tell me how to do so... my proj dline is in 2 weeks....i need desperate help.... 'm waitin... thxxxx... a ton hanish
hi all.. hope u guys can help me out here..... 'm new to .net so hope to get all the basic infomr that would b required...
'm on a proj..basically a data mining proj... 'm using sql 2005 enterprise edn's analysis services to perform my data minning tasks... here is what i'd like to know.... i've been following the sql online tutorial book... n as per the tutorial on data minning...i have created a data source ... based on the decision tree algorithm i have even obtained some results.. now.....here is the problem..
i'd like to know if i can actually get all these obtained patterns onto a webpage... i mean can i actually use asp.net n achieve this task of migrating the patterns generated at the bids to a webpage??
please guys if i can do so...then do tell me how to do so... my proj dline is in 2 weeks....i need desperate help.... 'm waitin...
here is how i vusualize my goal..... web pages that display patterns generated after an analysis has performed......
Fan of Sub's and I feel more comfortable doing them, I've been told they aren't as efficient as JOIN's by another developer. Is this true?
Also, does one or the other perform better on SQL Server vs. Oracle? I'm more seasoned as an Oracle developer and have learned to avoid JOIN's when ever possible. So I guess my real question is have I been led astray?
've installed sql 2005 xpress with advanced services......also installed the toolkit that came along..
all 'm interested in is to perform certain data mining operations on the adventureworks db..
;ve also installed the advn works db.........
now here is the prob.......
jus like how the sql online book instructed me i first started off with the datamining tutorial..where i was told to first OPEN BIDS select new PROJECT then make sure that the analysis Services template was selected and then go ahead with selection of the particular sln file....
the problem is that I DON'T SEE ANY ANALYSIS SERVICE TEMPLATE....all i c is a REPORT template..
i really need help guys..... 'm new to .net really feeling helpless...
I have a database which has contact column eg. Mr Peter Smith
I am writing a new database which is to have three seperate columns.. saluation, first name and surname. What would be the best way to split the column up?? I was thinking on concentrating on the spaces??
Note: some conacts may not have saluation inc in the contact column, and in this case the saluation column should be blank...
Can somebody please go in depth detail what exactly is done in OLAP? i know it deals with the data warehouse end. but what does the SQL DBA do in the OLAP end? please elaborate. thanks.
How can i get the details of the error in sql server 2000 such where itoccurs in which line. I need something like i get in sql query analyzer.--Message posted via http://www.sqlmonster.com
Where is, (or even does it exists) the best place to look for some details on when package execution fails if running as a scheduled job. Obviously when you run from the command line or in VS, there is plenty of output detail on progress and on the source of errors, but when you run it as a scheduled job, it just says step 1 failed in the sql server log, and package foo failed in the NT application log . Is there anywhere to find this info or do we need to build error traps into the package to write stuff out somewhere?
First, soapbox questions for someone who might have more direct pull with Microsoft (or at least knowledge of how I should work with what they've given us), then a more specific question: Scenario: You install SQL Server Express (or any other version, it doesn't matter) and the feedback with all the little green checkmarks tells you it has installed successfully. "Oh goody," say people (like me) who are not super experienced with SQL Server, "it installed successfully; now I can jump in and start using it!" But it aint so--there are so many other hoops to jump through before it really becomes operational. After successful installation, why can't some link become visible indicating what you have to do after that? I mean, it's fine to wade through all the questions in this forum and get answers from all you nice and informed guys, AFTER the problems start coming; but I would rather not have to associate with you, to be honest, in terms of time spent that could be going into my projects. Why isn't there a comprehensive guide right off the bat? That is, something referenced immediately that tells you such things as: how to register a database with emphasis on the fact that just creating a database won't do the trick for your application; how to set permissions and rights; that (what was I reading in the advice of one post?) you have to register both the database and the user, blah blah; all about instances, the web.config file, etc. etc. I mean, doesn't it seem logical that by virtue of a person installing the database, come on, that this is a pretty good indication that he/she in all likelihood is new at it? As it is now, all they tell you on the SSE site is that you have to have the .NET Framework installed; and the green checkmarks indicating that you've installed it correctly (sorry for mentioning that twice). "OK, self," I say, "I have the Framework installed and SSE installed correctly, so let's get to work." Then the trouble begins. Unless Microsoft's purpose is to keep you tech guys and book writers in business, I don't understand why they don't give more up-front guidance. Any thoughts on why they work it this way? Bueller, Bueller? Anyone, anyone? Now, to the question that's pressing me at the moment: I've installed SSE and I'm going through a tutorial ("How Do I: Create Data-Driven Web Sites?" on http://www.asp.net/getstarted/default.aspx?tabid=61). Yeah, the guy makes it look really easy. He creates a database then shuts down the connection. I try to do the same things and I'm informed that I don't even have a valid connection! How SQL-Server-Express fun and easy is that? It's a real AdventureWorks, if you ask me. OK, that's my rant; and since MS didn't think in advance and implement my idea of a link to jump off from the installation menu, I have to face the reality of learning this by putting all the pieces together myself. So, my question is, before I try to go through the video and get more frustrated, WHERE DO I GO FOR THE MOST BASIC OF ALL THE STEPS I NEED TO DO, ONE BY ONE? This is like the second "beginner" video I've tried to go through but even these don't start at the very beginning with information on how to register a new database, making the user a part of aspnetWHATEVER, what permissions to dole out, etc. Guidance is solicited and will be most appreciated. Thanks, Bryan
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
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. <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:bizConnectionString %>" SelectCommand="SELECT * FROM [AccountsTable] WHERE ([AccountNumber] = @AccountNumber)"> <SelectParameters> <asp:ControlParameter ControlID="GridView1" Name="AccountNumber" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource>
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)
Does anyone know if the enhanced data types (character length up to 8,000 bytes for some types) and the increase in the number of tables used in joins are available when using the 65 backward compatibility mode?
Please may I have your assistance with the following I’m struggling to view the transaction log for a database. I’m using the following command structure
DBCC log ( {dbid|dbname}, [, type={-1|0|1|2|3|4}] ) PARAMETERS: Dbid or dbname - Enter either the dbid or the name of the database in question.
type - is the type of output:
0 - minimum information (operation, context, transaction id)
1 - more information (plus flags, tags, row length)
2 - very detailed information (plus object name, index name, page id, slot id)
3 - full information about each operation
4 - full information about each operation plus hexadecimal dump of the current transaction log's row.
-1 - full information about each operation plus hexadecimal dump of the current transaction log's row, plus Checkpoint Begin, DB Version, Max XACTID
Which I got from a web site, however the output does not make sense to me
Ideally I would like to analyse which SQL insert commands are predominantly using the log file
Any ideas how to do this or a tool that u recommend
Need to ask this, 'cause as ya'all know I'm a GUID sort of guy with a sever IDENTITY crisis.
Got a client that erroneously deleted some records from a table with an IDENTITY key. We have a backup that we can restore to a new db to isolate the records that need to be reloaded. Question is, when we set IDENTITY INSERT to ON temporarily to reload the affected records, does the db need to be in single-user mode, or will it go merrily on creating IDENTITY values for new records if the db is in use during our fix? It is a 24/7 production db with web users around the country/world.
I am having a header table and details table and I want to display first 2 records against each header from details, whatever number of records are there in details against each header.
Example : ======= Details table is as follows HeaderID DetailsID 1 1 1 2 1 3 2 4 3 5 3 6 3 7 3 8
SELECT H.TransDate, H.SupplierName, D.DetailsID FROM Header H, Details D WHERE H.HeaderID = D.DetailsID AND D.DetailsID IN (SELECT TOP 2 DetailsID FROM Details WHERE HeaderID = H.HeaderID)
As I am dealing with very huge data it is taking very long time to execute.
I have a categories table and a products table, the products are associated with a category, and my current select statement looks like this..
SELECT COUNT(dbo.tbl_Categories.CatName) AS TotQty, dbo.tbl_Categories.CatName FROM dbo.tbl_Products INNER JOIN dbo.tbl_Categories ON dbo.tbl_Products.CatID = dbo.tbl_Categories.ID GROUP BY dbo.tbl_Categories.CatName
this give me ..
TotQty CatName 1 Books 2 DVD
I wonder how I can change the select statement so I retrieve a result like this..
TotQty CatName Description 1 Books Oliver Twist 2 DVD Dire Straits 2 DVD Elvis
I need to combine the details of two tables and narrow the data included.
in my tutor table i have
tutorLastName, tutorSessions and tutorSkills
in my term table i have
week, date, session_Name, tutorName
i need to combine the tales to show:
(from the term table) week, date,session_Name, tutorName, (from the tutor table) tutorSkills.
i then need to narrow the table down so it shows only tutors with guitar skills and the term dats when the session_name is empty
i can run the two searches sepereately but cannot combine them i am tryin to use Where date = "whateverdate" AND session_name is null AND tutorSkills = guitar
this is my first post and I am new to SQL server 2005 (well, SQL in general).
I have installed SQL server 2005 but cannot remember if I set authentication for it. I have just tried to access a database on this server through ASP (classic, not .NET) but get the error message saying that login failed for <servername>IUSR_<servername>.
There must be a simple way around this.
Also, is there a way for me to create trusted connections for my server now that it has been installed?
If anyone can give me a few ideas about authentication, etc, I would really appreciate it.
This is showing the details I am looking for. Is there a way to show the totals for the clients for 418 and totals for 417?
SELECT NAME.Nickname1, NAME_1.Nickname1 AS Expr1, SLPTRANS.ActyExpID, SLPTRANS.TimeSpent / 3600 AS Hours FROM CUSTOMC INNER JOIN NAME AS NAME_1 ON CUSTOMC.RecordIDQ = NAME_1.RecordID INNER JOIN NAME ON CUSTOMC.ControllerQ = NAME.RecordID INNER JOIN SLPTRANS ON CUSTOMC.RecordIDQ = SLPTRANS.ClientID WHERE (NAME.NameType = 0) AND (CUSTOMC.Service_Cont = 'YES') AND (SLPTRANS.ActyExpID = '417') OR (SLPTRANS.ActyExpID = '418') AND (SLPTRANS.StartDate BETWEEN @IncludeStartDate AND @IncludeEndDate)
I open up the SQL Server Agent Job window, and I can't see details under the General, Steps, Schedules, or other tabs unless I am running SSMS directly on that server. So much for remote management, eh? Anybody else experiencing this problem? Anybody else notice that jobs may fail to complete correctly without raising any errors or logging any issues? Anybody else remember when, a year ago, SQL Server was a good product? Anybody think Microsoft is listening? Anybody? Buehler? Buehler?
I am writing a script to update a version history table. There is a column called RELEASED_BY to be populated with details of who is implementing the release.
I have an insert query to place the data into the table.
How do I get the script to ask for the name of the person implementing the release instead of hard coding the information?
Where is the information coming from that is displayed in queryprofiler.Is it the command that is retrieved before it is processed, or is itwhat is actually processed.