i wanna add a new record into a access file by using sql "INSERT INTO". i wrote the following code in my project but i have an error message "Syntex error in INSERT INTO statement." Please tell me the correct syntex of INSERT INTO statement.My code is
Private Sub pbLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbLogin.Click
xConn = New sqlConn
xConn.connectMe("INSERT INTO tblSave (UserName, Password) VALUES ('" & txtUser.Text & "'," & txtPassword.Text & "');")
I want to backup an SQL Database that I already have a connection to. The Solutions Ive found on Code projects creates a new connection but I dnt need to do since I already got connection to Data source, I have dataset of the database on my project..I need help to modify the code below so it does not re-connect but uses current datasource and backs it up...
//class variable which came with solution
private static Server srvSql ;
privatevoid btnConnect_Click(object sender, EventArgs e)<br />
//// <br/> <br />
//I alreay hav a connection to the database so dnt need this<br />
ServerConnection srvConn = new ServerConnection("juji");<br />
// Log in using SQL authentication instead of Windows authentication<br />
srvConn.LoginSecure = false;<br />
//already hav a connection<br />
srvSql = new Server(srvConn);<br />
// Loop through the databases list,<br />foreach (Database dbServer in srvSql.Databases)<br />
// Adds database to combobox, but I dnt need this part since already have a connection<br />// cmbDatabase.Items.Add(dbServer.Name);<br />// }<br />
privatevoid btnCreate_Click(object sender, EventArgs e)<br />
if (saveBackupDialog.ShowDialog() == DialogResult.OK)<br />
// Create a new backup operation<br />
Backup bkpDatabase = new Backup();<br />
// Set the backup type to a database backup<br />
bkpDatabase.Action = BackupActionType.Database;<br />
// Set the database that we want to perform a backup on<br />
//I already know the name of the database but not sure if typing it out correctly, its kofle<br />
bkpDatabase.Database = "kofle";<br />
// Set the backup device to a file<br />
BackupDeviceItem bkpDevice = new BackupDeviceItem(saveBackupDialog.FileName, DeviceType.File);<br />
// Add the backup device to the backup<br />
// Perform the backup<br />//;<br />
I created a certificate in the master database so that my endpoint could use the certificate.
I dropped the endpoint and dropped the certificate and added a new one and created a new endpoint because the earlier one had a weak password.
This is SQL 2005 service pack 1.
Everything has been fine till we restarted the server. Master, model start up fine but now I am getting these errors.
(1.) FallBack certificate initialization failed with error code: 1.
(2.) Warning:Encryption is not available, could not find a valid certificate to load.
(3.) TDSSNIClient initialization failed with error 0x7e, status code 0x60.
(4.) TDSSNIClient initialization failed with error 0x7e, status code 0x1.
Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
(5.) SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
Is there a way to just start sql with master only? Ive tried moving the certificates to another location, renaming the database mdf file that uses the endpoint so it would go suspect.
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),
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
You would need to write a query that returns:
i) the total rent incurred thus far by each guest. This would presumably be the the number of days elapsed since the guest began their stay, multiplied by their daily rate
ii) the total amount paid by the guest thus far
Subtracting ii) from i) should give you the total amount currently owed by each guest.
I have 2 tables with same fields like event, venue, date and cost. Table 1 has 5 records and Table 2 has 100 records. How can i match a record from Table 1 with Table 2 to get the exact match record of Table 1 record. Event Venue fields are string datatypes which will not have same records. I need the nearest match .Please help me out. Thanks in advance.
Last Visit: 31-Dec-99 19:00 Last Update: 10-Dec-23 10:29