|
Hi,
In my table I have one column of type Image. I want to copy image from one row to another.
I'm using WRITETEXT and READTEXT. Following is the code for it but it's not working..pls help me out...
DECLARE @srcPtrVal binary(16)
SELECT @srcPtrVal = TEXTPTR(COL_Image) FROM Table1 WHERE id = 3
DECLARE @DestPtrVal binary(16)
SELECT @DestPtrVal = TEXTPTR(COL_Image) FROM Table1 WHERE id = 6
WRITETEXT Table1.COL_Image @DestPtrVal (READTEXT SMP_Catalogue_Item.SMP_CI_Image @srcPtrVal 100)
Vijay
|
|
|
|
|
Have you solved this problem? I would imagine you make a temporary copy of the image and then insert into another row.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi
I need query to insert image directly to table field
please send me the answer
Thanks in advance.
Haritha
|
|
|
|
|
insert into (imagefield) values (@image) Do you need to know more, such as how to call this from .NET? Please provide more information than this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Could some1 help me with a query which will allow me to get a list of related tables for a particular table.
for eg. suppose the user selects 'Product' table , i need a list of tables that are related to the product table
Thanks.
|
|
|
|
|
hi
this qry will give u all the related tables of table 'Product'
select t.name from sysobjects t,syscolumns c where t.id=c.id and c.name in
(select c.name from sysobjects t,syscolumns c
where t.id=c.id and t.name='Product')
|
|
|
|
|
You haven't explained the problem thoroughly enough. What is the purpose of these tables? What fields do they have?
Paul
|
|
|
|
|
|
This query will insert the product of the User and Work tables into the Grade table:
INSERT INTO Grade (T_number, WorkName)
SELECT User.T_number, Work.WorkName
FROM User, Work
Regards
Paul
|
|
|
|
|
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
Try
xConn = New sqlConn
xConn.connectMe("INSERT INTO tblSave (UserName, Password) VALUES ('" & txtUser.Text & "'," & txtPassword.Text & "');")
Try
xConn.OLEComm.Connection = xConn.OLEConn
xConn.OLEComm.ExecuteNonQuery()
xConn.OLEConn.Close()
MsgBox("Record Added")
Catch err As System.Exception
MsgBox(err.Message)
End Try
Try
xConn.OLEConn.Close()
Catch err As System.Exception
MsgBox(err.Message)
End Try
Catch err As System.Exception
MsgBox(err.Message)
End Try
End Sub

|
|
|
|
|
phowarso wrote: xConn.connectMe("INSERT INTO tblSave (UserName, Password) VALUES ('" & txtUser.Text & "'," & txtPassword.Text & "');")
Your SQL statement is missing an apostrophe. It should read:
xConn.connectMe("INSERT INTO tblSave (UserName, Password) VALUES ('" & txtUser.Text & "','" & txtPassword.Text & "');")
Regards
Paul
|
|
|
|
|
i have been inserted your code. but i get the same error message.please give me another way... 
|
|
|
|
|
I don't know why it isn't working. Try debugging your code, copying the SQL statement generated into Query Analyser and running the query. You should be able to see then what the problem is.
Paul
|
|
|
|
|
Don't use direct SQL such as this. You leave yourself wide open to Sql Injection attacks. See this[^] article. BTW - doing this the proper way makes code like this easier to write as well.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Please don't cross-post.
Paul
|
|
|
|
|
Hari Om Prakash Sharma wrote: Is there from_unixtime() function in c#.net
No.
Errm. You do realise that this is a SQL forum don't you. I can only assume that you have undertaken a massive attack of cross posting here.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi guys
Im transfering data from sql server 2005 to
comapact framework database (*.sdf)
My way to do so is :
Export the table into an XML file (using DataTable)
dt.WriteXml(FName, System.Data.XmlWriteMode.IgnoreSchema)
And on the mobile device I load the XML and save the Dataset
dt.ReadXml(FileName)
da.Update(DataSet11)
Everything is working only my table contains about 1500 records (20 fields)
and it takes about 6 minutes to load and save.
Is there any way or Method to do this any faster ?
Thanks in Advance
Pam.
|
|
|
|
|
Have you solved this problem?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
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 ;
private void btnConnect_Click(object sender, EventArgs e)<br />
{<br />
<br />
<br />
<br />
ServerConnection srvConn = new ServerConnection("juji");<br />
<br />
srvConn.LoginSecure = false;<br />
<br />
<br />
srvSql = new Server(srvConn);<br />
foreach (Database dbServer in srvSql.Databases)<br />
{<br />
<br />
}<br />
private void btnCreate_Click(object sender, EventArgs e)<br />
{<br />
if (saveBackupDialog.ShowDialog() == DialogResult.OK)<br />
{<br />
Backup bkpDatabase = new Backup();<br />
bkpDatabase.Action = BackupActionType.Database;<br />
<br />
bkpDatabase.Database = "kofle";<br />
<br />
BackupDeviceItem bkpDevice = new BackupDeviceItem(saveBackupDialog.FileName, DeviceType.File);<br />
bkpDatabase.Devices.Add(bkpDevice);<br />
}<br />
}
Thanks in Advance
Is this chair taken
|
|
|
|
|
Have you solved this problem?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
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.
|
|
|
|
|
Hi
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
|
|
|
|
|
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.
Regards
Paul
|
|
|
|
|
Hi,
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.
Jebin
|
|
|
|