Hi I am trying to create a database using T-SQL and i am getting the following error message. Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\saledat.mdf" failed with the operating system error 3(The system cannot find the path specified.). Msg 1802, Level 16, State 1, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors. I am using SQL server express 2005 which I recently installed on a new desktop. The script I am using to create the database is as follows. USE master; GO CREATE DATABASE Sales ON ( NAME = Sales_dat, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\saledat.mdf', SIZE = 10, MAXSIZE = 50, FILEGROWTH = 5 ) LOG ON ( NAME = Sales_log, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\salelog.ldf', SIZE = 5MB, MAXSIZE = 25MB, FILEGROWTH = 5MB ) ; GO I don't know what could be causing this error, and I would appreciate any help granted. Thanks in advance
twsted f8
Posts
-
Can't Create database -
Disabling Crystal loginHi I was wondering, is it possible to disable the logon screen when using crystal reports. I would like my app to logon the user automatically. Is this possible and if so how would I go about this? Kind Regards F8
-
Excel TablesI am developing a Win app that pulls data from a datagridview control onto an excel spreadsheet.The app is doing this so far but I would like to knw if it is possible to present this data in a table .Is it possible, and if so how?
-
multiple sql queriesHie I am new to sql 05, and am buiding a windows app for a hotel. I would like to to retrieve the number of occupants in the various types of rooms on a between a specified date range. eg from the 1st of the month to the end of the month. For each day in the specified range I would like to retrieve the number occupants in each type of room. I have been able to do this by generating a different select statement for each day that is automatically updated by the program. I however feel that this method is very inefficient and would like to use a single sql statement to pull the data from the database and place it into a datatset. Does anyone have any idea on hw i cld get around this. thank u. tw5ted f8
-
crystalHi everyone I am using crystal reports to generate a recepit for clients in my app. This recepit shpuld be based on the last receipt number entered into the database. In order to do this I would need to pass parametrs to Crystal. Does any one out there know how this can be done? How do you pass parameters to Crystal? I have heard of SQL server reporting tools, are these tools availible in SQL server 2005 express edition? Thank you vety much for your time. I hope you will be able to help me.
-
Refreshing a drawingHi everyone I got a small problem I have devloped hotel software and I am trying to draw achart that shows %age occupancy. I would like to draw a pie chart on a form. I have managed to do this so far,the chart is being drawn when the form loads. I would like the form to be able to redraw when a user specifies a different date such that you can view the past occupancy. The code I am using is shown below. I hope you will be able to help me. twisted F8 Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim TotalCount As Single Dim rect As Rectangle = New Rectangle(100, 105, 150, 150) For Each gd As GraphData In occupancy TotalCount += gd.percentageocc Next Dim g As Graphics = e.Graphics ' Create variables to hold the changing values of Angles g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality Dim StartAngle As Single = 0 Dim SweepAngle As Single = 0 For Each gd As GraphData In occupancy SweepAngle = 360 * gd.percentageocc / TotalCount g.FillPie(New SolidBrush(gd.Clr), rect, StartAngle, SweepAngle) StartAngle += SweepAngle Next ' g.DrawPie(New Pen(Color.Brown), rect, StartAngle, SweepAngle) ' Create a Brush to draw the text Dim TextBrsh As Brush = New SolidBrush(Color.Black) ' Create a Font object instance for text display Dim TextFont As New Font("Arial", 12, FontStyle.Bold) g.DrawString("Chart Key", TextFont, TextBrsh, 310, 100) Dim pxFromTop As Integer = 135 For Each gd As GraphData In occupancy ' Draw bullet g.FillEllipse(New SolidBrush(gd.Clr), 310, pxFromTop, 15, 15) ' Draw line round bullet. g.DrawEllipse(New Pen(Color.Black), 310, pxFromTop, 15, 15) ' Draw the text - color coded g.DrawString(gd.Description & " (" & gd.percentageocc & "%)", TextFont, TextBrsh, 360, pxFromTop) ' Increase gap from Top for next line pxFromTop += 30 Next End Sub
-
ReportingHi everyone I am using vb.net 2005, and I am trying to get information on how to use the reports that come with it. I would like to generate reports that would serve as invoices from a sql server database and I would want to do this programmatically. I have tried using crystal but that does not seem to be getting me any where, a m getting a load report error. Does anyone know a site where I could get information on these reports that come with vb.net and just out of interest are these the SQL server reports. Thanks for reading this tw5ed f8
-
crystalhi everyone. I am quite new to vb.net 2005 and I have been trying to connect my database programmatically to my sql server database. I have moved from one error to the next and I have followed the steps highlighted in the msdn walk through on crystal reports. Every time I run my code, I am getting an error message that states that the load report event has failed. and the object reference has not been set to an instance of the object. I have tried this several times and I don't know what to do. If anyone can help me I would be most greatful. The code I have been trying to use is as follows. Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class Form1 Private Sub ConfigureCrystalReports() Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = "Northwind" myConnectionInfo.UserID = "user" myConnectionInfo.Password = "bob123" myConnectionInfo.ServerName = "chiko-shumba" Dim reportPath As String = Application.StartupPath & "\" & "NorthwindCustomers.rpt" myCrystalReportViewer.ReportSource = reportPath SetDBLogonForReport(myConnectionInfo) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ConfigureCrystalReports() End Sub Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo) Dim myTableLogOnInfos As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos myTableLogOnInfo.ConnectionInfo = myConnectionInfo Next End Sub Private Sub myCrystalReportViewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles myCrystalReportViewer.Load End Sub End Class
-
setting up CrystalHi Has any one out there used crystal with sql server to generate reports? I have been trying to get my code running that passes my login info and password to sql automatically. I have followed the instructions in the MSDN to set up these reports and one of the variables which I know I have declared is simply not being picked up. The code I ahve been making use of is as follows Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Public Class Form1 Private Sub configurecrystalreports() Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = "Northwind" myConnectionInfo.UserID = "limitedPermissionAccount" myConnectionInfo.Password = "1234" Dim reportpath As String = Application.StartupPath & "\" & "northwind.rpt" myCrystalReportViewer.ReportSource = reportpath setdblogforreport(myConnectionInfo) End Sub Private Sub setdblogforreport(ByVal myconnectioninfo As ConnectionInfo) Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos] ' vbstates that I 'have not declared mytablelogonInfo. myTableLogOnInfo.ConnectionInfo = myconnectioninfo Next End Sub I have gone over the instructions in the MSDN several times and I am still getting the same error. What am I doing wrong, or is there an easier way of doing this that is not using the wizards?
-
ReceiptsHi everyone I am developing software for a hotel and I need to find a way printing receipts s of payment after a guest has paid their rent. How can this be done? I am storing all the information pertaining to the payments in a table in the database. Can I use crystal reports for this. What are the options?
-
Close downHi everyone Could anyone help me. I would like to restrict the users of my software from maximise the form. Is there any way of disabling the form maximise property? The other thing is I would also like to detect when the user closes the form using the X in the right corner.I would like to ask the user if they want to save before closing down. What event is this and how is it called? Thanks for reading this and I hope u will be able to help me.
-
Is there a way out?Hi Thanks for the help, I deleted the bin and obj folders and then rebuilt, and the app is now working fine. Thanks a million
-
Is there a way out?Hi Thanks for the quik reply. I have just tried that, & it seems even that has failed. I am still getting a different form to the one that I have set as the start up object. If anyone can help me, I would be most greatful
-
Is there a way out?I have tried running the individual forms, I have changed the start up object for the project setting it to a different form. When I run the program, a different form from the one I selected as the start up object is being displayed. The forms I altered and built when I had changed the date are not being loaded. I hope u will be able to help me
-
Is there a way out?Hi friends Am in a bit of a fix. I have changed my system date on my pc, to the 29th of October, test the functionality of the app I was developing. I have returned the date to the presnt date but now I cant even run the other forms that I had built durng that time. Does anyone out there know how to fix this or I gotta redo my forms? thanks for reading this tw5ted f8 I
-
Concurency IssueHi Friends Am in a bit of a pickle, and I now don't know how to fix this. I am trying to update the data in my dataset, and I am getting a concurrency violation. The application I am developing is to be used by, only one user, and there is no way that some one else could be using the dataset. What could be the cause of this? Thanks , I hope u will be able to help me.
-
help me with outstanding rental paymentsHi I am currently developing hostel management software for a local hostel. I am trying to find a way of identifying those residents who have outstanding rent payments. The hotel/ youth hostel requires that its guests pay their rentals at the beginning of the month. The residents often stay at the hostel for periods that are often over 5 months.I need to find a way of finding out which residents have paid their renatals, and which ones have not paid their rents. This is further complicated by the fact that some residents will make one large payment at the beginning of their session and this is meant to cover them for the duration of their stay. Each session has one account, and the total payments made are stored in the acount. I have also included the rate charged per day and the startdate of the session into the table, such that it is possible to calculate the amount that is owed and this figure can be some how be compared to the amount that has been paid. Given these circumstances, how can I find the residents who have outstanding rents. I havce included the table defs below. Please do feel free to help me. create table sessions ( sessionNumber int Identity Not null Primary Key, startdate smalldatetime not null, enddate smalldatetime not null, sessionType char(15) not null, duration int not null, roomNumber char(5) not null references Rooms (roomNumber), idNumber char(15) Not null references guestinfo (idnumber), ) create table accounts ( receiptNumber int Identity Not Null primary key, amountpaid money not Null, datepaid smalldatetime not null, roomNumber char(5) not null references rooms(roomNumber), sessionNumber int Not null references sessions(sessionNumber), paymentType char(10), userName char(15) Not Null references users (username), ) ---create table accpayments--- ( accountNumber int identity Not Null primary key, sessionNumber int not null references sessions(sessionNumber), totalpaymentsmade money not null, amountowing money not null, rate money not null ) twsted f8
-
Automatic updatesHi Can any one out there help me? I have got a database table which contains sessions that are in progress. Each session has a session balance and this session balance is meant to change after every month. The session balance should be deducted by the going rate at the end of every month. What am I suppose to use and how can I go about this? Any help will be most appreciated.
-
Data gridviewHi All, I need help in passing data from a datagridview control to textboxes control. When the user doubleclick a value from a datagridview control in form1, I want the record to be displayed in the texboxes of form2. How do I go about coding this? Any help would be most welcome. Cheers .
-
helpHi Thanks for helping. I do have a group box on the form. I still got a bit of a qn? What do u mean by iterate over the controls of the form, How could I go about this? Thanks again. twsted f8