|
PIEBALDconsult wrote: Firebird...
It's okay. I've used it on a few projects in the past.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
I thought that "@param" named-parameters were only supported by the SQL-Server provider. Have you tried using a "?" positional-parameters in your command text?
|
|
|
|
|
Other databases do too, even Access/Jet.
|
|
|
|
|
Thanks so much. The ? worked.
|
|
|
|
|
I got select first_name from employee where emp_no=@Param0 to work as expected using the Firebird .net connector. (ODBC is so '80s.)
Thanks for giving me the opportunity add support for another database to my library.
|
|
|
|
|
Ha, anything that I can do to strike up some nostalgia.
|
|
|
|
|
Fortunately I got to skip ODBC; went from embedded SQL to ADO.net
|
|
|
|
|
I am trying to overcome the quote-problem with Unicode to Iso-8859-1
In My C# programm I add values from a ListBox to a string like
12, 45 etc.
Now my Sqlparameter should see only 12, 45. Sql Profiler Says '12, 45'.
How can I get rid off these quotes (') ?
I tried by adding quotes during the process in C#
so the string will be 19', '41 which is translated ti SqlServer 2000 in:
exec SP_GET_ConsolidatedReportMonthYears @ProgrammeID = '19'', ''41'
Why does an added Quote be doubled ?
Searching the internet shows me
http://codeedoc.com/c/hot-to-convert-string-encoding-for-database-use with the next code
<br />
public static string Iso8859_To_Unicode(string input) {<br />
Encoding iso = Encoding.GetEncoding("iso8859-1″);<br />
Encoding unicode = Encoding.UTF8;<br />
byte[] isoBytes = iso.GetBytes(input);<br />
return unicode.GetString(isoBytes);<br />
}<br />
public static string Unicode_To_Iso8859(string input) {<br />
Encoding iso = Encoding.GetEncoding("iso8859-1″);<br />
Encoding unicode = Encoding.UTF8;<br />
byte[] unicodeBytes = unicode.GetBytes(input);<br />
return iso.GetString(unicodeBytes);<br />
}<br />
Even that doesn't help me.
Sql Profiler still shows
exec SP_GET_ConsolidatedReportMonthYears @ProgrammeID = '19'', ''41'
how to avoid the '' issue? (and just have a single-quote)
-- modified at 9:12 Tuesday 25th September, 2007
|
|
|
|
|
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
|
|
|
|