|
Makes me think of the "hey I found this site.." posts spam on usenet - that is not a good thing
|
|
|
|
|
Tooting your own horn?? What's the point of constantly posting "Hey I wrote this cool article" every four hours?? You're not going to get MVP status by doing that, if that's you're motivation.
|
|
|
|
|
Dave Kreskowiak wrote: You're not going to get MVP status by doing that, if that's you're motivation.
I don't know, if he keeps it up he's a shoe-in for the Most Vapid Prat award.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
<JSOP>
Don't univote someone's articles because you think they're an idiot on the forums
</JSOP>
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Awww!!!
|
|
|
|
|
Hi,
I have a COM component where i have declared restricted/hidden methods and properties.Using Reflection I am accessing these methods and properties.Is there any way to filter out restricted properties alone? I can able to do for methods but not for properties.
here is my code for methods:
foreach (MethodInfo mInfo in obj.GetMethods())
{
string FuncAttrib = "";
TypeLibFuncAttribute attrib = null;
attrib = (TypeLibFuncAttribute)Attribute.GetCustomAttribute(mInfo, typeof(TypeLibFuncAttribute));
if (null != attrib)
{
FuncAttrib = attrib.Value.ToString();
}
//Filter the Restricted methods.
if ((FuncAttrib.Contains("FRestricted")) || (FuncAttrib.Contains("FHidden")))
{
//here we will get only restricted.Hidden methods
}
}
This is working fine for methods.here I have used TypeLibFuncAttribute which is applicable to method alone.Can anyone help to apply this logic to properties?I have searched the attribute similar to method but not able to get......
Thanks,
Rajan.
|
|
|
|
|
A am using access mdb database and using obleDB class.
when i run insert query on this table it runs successfully but record does not appear into data table.
i am using ..
objConnection1.Open();
objCommand = new OleDbCommand(Sqlstr, objConnection1);
Data = objCommand.ExecuteNonQuery();
// it gives data = 1
my connection is ok because i am getting value using this connection when i use Executescalar() on this command object
why it is.....
|
|
|
|
|
Whats your query string? i.e. the value of Sqlstr
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
string Sqlstr = "INSERT INTO student(stu_id,stu_fnm) VALUES (" + textBox1.Text.Trim() + ",'" + textBox2.Text.Trim() + "') ";
// it is inserting record when i run it into sql pane .
and
objConnection1 = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=score.mdb");// is connection string
// i tried same for sql server database it works fine
// but i want to do it for access..
|
|
|
|
|
well your query string look ok, apart from the fact you should be using command parameters to insert data from textBoxes. Is a row being created in the database at all? with just blank data?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Because you're executing a non-query[^]. As the documentation states;
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
Your query affected 1 row, and that's what the function returns. Use a DataReader te read your row
I are troll
|
|
|
|
|
but i want to insert record into table .
|
|
|
|
|
Aw, I thought you wanted to insert your rows into a DataTable object. I should learn to read decently before answering a post.
In that case the ExecuteNonQuery is correct, my apologies. That would return "1" if it added a record. You might want to use parameters in your Insert-statement, that would also prevent some problems with SQL Injection and quoted strings. Take a look at OleDbParameter
I are troll
|
|
|
|
|
Can someone teach me how to compile a project like "Sandcastle File Help Builder" with makefile?
I'm a new user for Visual C# and I've just used a normal function to create .exe till now.
Regards,
Christian
|
|
|
|
|
Makefiles are not required to compile a C# app. Don't you have Visual Studio installed?
|
|
|
|
|
Yes. I use Visual Studio 2005. Maybe you can also see the Sandcastle-Source-Code which also can be downloaded here by codeproject.This source code has makefile in each c# project
|
|
|
|
|
|
Not a valid month error (ORA-1843)
More fun with ODP.NET - Tried different format string none worked!! wasted couple of hours!!
My table column is defined as:
CreateDate timestamp default sysdate NOT NULL
This is first thing I tried (most intuitive right?) This don't work ...
<br />
oParam.DbType = DbType.DateTime;<br />
oParam.Value = DateTime.Now;<br />
Error message in this case was: "ORA-01858: a non-numeric character was found where a numeric was expected"} System.Exception {Oracle.DataAccess.Client.OracleException}
So I tried many things... no luck
<br />
oParam.Value = DateTime.Now.ToString("dd-MMM-yy");
oParam.Value = DateTime.Now.ToString("dd-MM-yy");<br />
oParam.Value = DateTime.Now.ToString("MM-dd-yy");<br />
oParam.Value = DateTime.Now.ToString("MM/dd/yy");<br />
oParam.Value = DateTime.Now.ToString("dd/MM/yy");<br />
Also tried different combinations using MMM, NO LUCK!!
I then Checked db date format via:
select sysdate from dual;
SYSDATE
16-APR-09
1 row selected.
Last trick (Works but UGLY) - use to_date function in my sql statement + string concatenation instead of parameter!!!
select to_date('16-4-09', 'dd-mm-yy') today from dual
Code:
if (oContext.DefaultDBProvider == DBUtil.DataProvider.OracleODAC || oContext.DefaultDBProvider == DBUtil.DataProvider.OracleProvider)<br/>
{
strSQL_insert = strSQL_insert.Replace(ORACLE_CREATEDATE, "to_date('" + DateTime.Now.ToString("dd-MM-yy") + "', 'dd-MM-yy')");
}
else
{
oParam = oCmd.CreateParameter();
oParam.ParameterName = DBUtil.FixParameterNameForOracle(oContext.DefaultDBProvider, "@CreateDate");
oParam.Direction = ParameterDirection.Input;
oParam.DbType = DbType.DateTime;
oCmd.Parameters.Add(oParam);
}
Any suggestion? I've isolated the one offending parameter but need the right "format" and ora messages is not helpful at all.
REF:
http://forums.oracle.com/forums/thre...hreadID=631236
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
dev
modified on Thursday, April 16, 2009 9:14 AM
|
|
|
|
|
try "yyyy-MM-dd" (and read ISO 8601 standard).
|
|
|
|
|
yeah tried that too not good mate
dev
|
|
|
|
|
btw - using MMM means month is non-numeric.
<br />
CASE 1: dd-MMM-yy ---> 16-Apr-09<br />
CASE 2: dd-MMM-yy hh:mm:ss.ffff tt ---> 16-Apr-09 08:50:46.6093 PM<br />
In both cases, you'd end up with:
<br />
ORA-01858: a non-numeric character was found where a numeric was expected"} System.Exception {Oracle.DataAccess.Client.OracleException}<br />
dev
|
|
|
|
|
devvvy wrote: using MMM means month is non-numeric
I am familiar with DateTime type, and all databases I used so far accept "yyyy-MM-dd";
Oracle is not amongst them.
|
|
|
|
|
yes my code works for M$SQL + MySQL too, just seems like it's not friendly with Oracle...
dying.. ekkkKK
dev
|
|
|
|
|
Problem resolved, thanks to Alex Oracle Consultant!
http://forums.oracle.com/forums/thread.jspa?messageID=3407801#3407801
dev
|
|
|
|
|
good for you!
I understood:
1. to_date() is unavoidable with Oracle?
2. parameter order is relevant unless some flag set true (where?)
|
|
|
|