|
spooky manus wrote: Now my Sqlparameter should see only 12, 45. Sql Profiler Says '12, 45'.
I don't know why you think that should be so. String values are always delimited with single quotes.
perhaps if you actually showed the code that constructs the SqlParameter from the listbox, someone might be able to help.
|
|
|
|
|
@ your service
<code>
if (SyconosBase.ListBoxHasSelectedItems(lbProgramme))
{
ddlReportMonthYear.Enabled = false;
btnRunReport.Enabled = false;
Char quote = (char)0039;
Char komma = (char)0044;
String Programmes = String.Empty;
Int16 AantalSelecties = 0;
for (int listItem = 0; listItem < lbProgramme.Items.Count; listItem++)
{
if (lbProgramme.Items[listItem].Selected)
{
AantalSelecties++;
if (!Programmes.Equals(String.Empty))
{
Programmes += quote;
Programmes += komma;
Programmes += quote;
}
Programmes += lbProgramme.Items[listItem].Value ;
}
}
LoadReportMonthYear(Programmes);
}
</code>
Method LoadReportMonthYear:
<code>
SqlParameter[] arrParameter = new SqlParameter[1];
arrParameter[0] = new SqlParameter("@ProgrammeID", SyconosBase.Unicode_To_Iso8859(Programmes));
</code>
|
|
|
|
|
Pls can someone tell me how to retrieve the correct time from an sql server and pass the value into a string to be used in an application.
IT'S GREAT TO BE HERE
|
|
|
|
|
Sql Server has the function Getdate() to get the date. It's not necessarily the correct time, because that depends on how the server is set up. To use it, you would create a stored procedure to get the value return it as a DateTime, and then convert it into the dateformat based on your culture.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have a sql where i need to add root node...
Current SQL
SELECT CategoryId,CategoryDesc
FROM TB_CategoryMaster AS Category
WHERE CategoryActive=0
ORDER BY CategoryDisplayOrder
FOR XML AUTO, ELEMENTS, TYPE
output : <Category><CategoryId>1001</CategoryId><CategoryDesc>Automobiles</CategoryDesc></Category>
But i want
<root>
<Category><CategoryId>1001</CategoryId><CategoryDesc>Automobiles</CategoryDesc></Category>
</root>
any help?
|
|
|
|
|
Are you using the SQLXML Managed Classes to fetch your data? If so, set the RootTag property of your SqlXmlCommand object to "root" before executing the query.
Paul
|
|
|
|
|
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
|
|
|
|