Click here to Skip to main content
15,885,309 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sharp Develop Regular Expression Pin
Paul Conrad30-Jul-07 6:22
professionalPaul Conrad30-Jul-07 6:22 
QuestionAccess to the class variable in the Program.cs Pin
UweOeder30-Jul-07 5:31
professionalUweOeder30-Jul-07 5:31 
AnswerRe: Access to the class variable in the Program.cs Pin
led mike30-Jul-07 5:47
led mike30-Jul-07 5:47 
AnswerRe: Access to the class variable in the Program.cs Pin
PhilDanger30-Jul-07 6:05
PhilDanger30-Jul-07 6:05 
GeneralRe: Access to the class variable in the Program.cs Pin
UweOeder30-Jul-07 21:00
professionalUweOeder30-Jul-07 21:00 
QuestionDataGridView Max Rows Pin
jasper01830-Jul-07 5:22
jasper01830-Jul-07 5:22 
AnswerRe: DataGridView Max Rows Pin
led mike30-Jul-07 5:26
led mike30-Jul-07 5:26 
QuestionC# Prep Statement doesn't insert string Pin
NRworld30-Jul-07 4:43
NRworld30-Jul-07 4:43 
Hi,

I am facing a problem while using pepared statement for inserting data in MS-Access db.


<code>private const String CONN_STR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\TestDb.mdb";
conDatabase.Open(CONN_STR, "", "", -1);
String sQuery = "INSERT INTO " + sTableName +
" ([FileName],[IsCopied],[Size]) VALUES (@FileName,@IsCopied,@Size)";
cmdPrepStmnt.ActiveConnection = conDatabase;
cmdPrepStmnt.CommandText = sQuery;
cmdPrepStmnt.CommandType = CommandTypeEnum.adCmdText;
cmdPrepStmnt.Prepared = true;
int iCount = 0;
foreach (FileInfo f in fInfo)
{
Console.WriteLine("Adding File " + ++iCount + " of " + fInfo.Length + "; " + f.Name);
Parameter p1 = cmdPrepStmnt.CreateParameter("@FileName", ADODB.DataTypeEnum.adVarWChar, ParameterDirectionEnum.adParamInput, 255, f.FullName);
Parameter p3 = cmdPrepStmnt.CreateParameter("@IsCopied", ADODB.DataTypeEnum.adBoolean, ParameterDirectionEnum.adParamInput, 10, false);
Parameter p5 = cmdPrepStmnt.CreateParameter("@Size", ADODB.DataTypeEnum.adInteger, ParameterDirectionEnum.adParamInput, 10, f.Length);
cmdPrepStmnt.Parameters.Append(p1);
cmdPrepStmnt.Parameters.Append(p3);
cmdPrepStmnt.Parameters.Append(p5);
cmdPrepStmnt.Execute(out objAffected, ref obj, 0);
}

</code>
FileName is coming as blank in db, while in debug mode i can see that it is being set with a proper filename. The other 2 params are inserting fine.

The FileName field is set as Text field with width length 255, and the incoming data is always shorter than 255 chars. The insertion happens without any errors/exceptions. I have also tried replacing the data for filename with a string like "Test", still it is inserting blank string.

Please help.<code></code>
AnswerRe: C# Prep Statement doesn't insert string Pin
Pete O'Hanlon30-Jul-07 9:49
mvePete O'Hanlon30-Jul-07 9:49 
GeneralRe: C# Prep Statement doesn't insert string Pin
PIEBALDconsult30-Jul-07 11:23
mvePIEBALDconsult30-Jul-07 11:23 
Questioncomand line Pin
ankit_mait30-Jul-07 4:30
ankit_mait30-Jul-07 4:30 
AnswerRe: comand line Pin
CPallini30-Jul-07 4:38
mveCPallini30-Jul-07 4:38 
QuestionIs there a way to disable "Close" button on title bar? Pin
Tesic Goran30-Jul-07 4:21
professionalTesic Goran30-Jul-07 4:21 
AnswerRe: Is there a way to disable "Close" button on title bar? Pin
originSH30-Jul-07 4:52
originSH30-Jul-07 4:52 
GeneralRe: Is there a way to disable &amp;quot;Close&amp;quot; button on title bar? [modified] Pin
Tesic Goran30-Jul-07 5:02
professionalTesic Goran30-Jul-07 5:02 
GeneralRe: Is there a way to disable &amp;quot;Close&amp;quot; button on title bar? Pin
originSH30-Jul-07 5:20
originSH30-Jul-07 5:20 
GeneralRe: Is there a way to disable &amp;quot;Close&amp;quot; button on title bar? Pin
Tesic Goran30-Jul-07 5:47
professionalTesic Goran30-Jul-07 5:47 
GeneralRe: Is there a way to disable &amp;amp;quot;Close&amp;amp;quot; button on title bar? Pin
originSH30-Jul-07 6:08
originSH30-Jul-07 6:08 
GeneralRe: Is there a way to disable &amp;quot;Close&amp;quot; button on title bar? Pin
PIEBALDconsult30-Jul-07 11:25
mvePIEBALDconsult30-Jul-07 11:25 
QuestionAlternative to Pegasus ImagXpress Pin
R.Myers30-Jul-07 3:43
R.Myers30-Jul-07 3:43 
AnswerRe: Alternative to Pegasus ImagXpress Pin
GrinderDev30-Jul-07 4:03
GrinderDev30-Jul-07 4:03 
GeneralRe: Alternative to Pegasus ImagXpress Pin
R.Myers30-Jul-07 7:10
R.Myers30-Jul-07 7:10 
AnswerRe: Alternative to Pegasus ImagXpress Pin
Joseph Guadagno30-Jul-07 4:19
Joseph Guadagno30-Jul-07 4:19 
GeneralRe: Alternative to Pegasus ImagXpress Pin
R.Myers30-Jul-07 7:11
R.Myers30-Jul-07 7:11 
GeneralRe: Alternative to Pegasus ImagXpress Pin
Joseph Guadagno30-Jul-07 8:19
Joseph Guadagno30-Jul-07 8:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.