|
I don't know ASP, so can't comment. Though, apart from accidentally wrapping the last part of your question in the pre tags, there is one thing that's perhaps (hopefully) a mistake.
You might notice that this is a C# forum. Clearly your code is ASP.
Perhaps you'd get a better response if you posted it here[^]
|
|
|
|
|
|
Couldn't you just set the caption to "PINview +"?
/ravi
|
|
|
|
|
I have an icon that I want to use
|
|
|
|
|
|
There's an article on CodeProject[^] how to draw in the title bar of a form.
Bastard Programmer from Hell
|
|
|
|
|
|
You're welcome
|
|
|
|
|
Not sure why this got a downvote, it's not a trivial 'gimme codez' question.
|
|
|
|
|
Hello!
I cannot change the password in System.Data.Sqlite DB.
Here is the code:
_DB = new SQLiteConnection("Data Source=" + db + String.Format(";Password={0}",
Convert.ToBase64String(password)));
Later I do this:
_DB.SetPassword(Convert.ToBase64String(newPassword));
But when I open the DB again, I get the error:
"File is encrypted or is not a database..." - the same when open with wrong password.
But after changing the password this way, the DB is still OK until application close.
If I do:
_DB.Open();
_DB.ChangePassword(Convert.ToBase64String(password));
_DB.Close();
I cannot access DB after this.
|
|
|
|
|
amrok2amrokk wrote: _DB.SetPassword(Convert.ToBase64String(newPassword));
This line isn't intended to change a password. In SqlLite, you use this to set the password for the database before you issue the Open command.
|
|
|
|
|
Well, it seems
SetPassword() has to be issued before every
Open() after
ChangePassword() has been called.
|
|
|
|
|
There is something strange going on. It's written in documentation:
SQLiteConnection.Open Method
Opens the connection using the parameters found in the ConnectionString
But when I change the password
DB.Open(); DB.ChangePassword("newpass"); DB.Close(); and change the password parameter in connection string, I still cannot decrypt DB with new password.
|
|
|
|
|
So I fixed that: changed Base64 string to UTF8 and with update of ConnectionString it works now.
Thanks
|
|
|
|
|
private DataTable AddNewRowToGrid()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
drCurrentRow = dtCurrentTable.NewRow();
dtCurrentTable.Rows[i - 1]["EffectFrom"] = ((TextBox)mdlpopupGrid.Rows[rowIndex].Cells[1].FindControl("txtEffectFrom")).Text;
dtCurrentTable.Rows[i - 1]["EffectivePercentage"] = ((TextBox)mdlpopupGrid.Rows[rowIndex].Cells[2].FindControl("txtEffectivePercentage")).Text;
dtCurrentTable.Rows[i - 1]["Grade_Salary"] = ((TextBox)mdlpopupGrid.Rows[rowIndex].Cells[3].FindControl("txtGradeSalary")).Text;
rowIndex++;
}
dtCurrentTable.Rows.Add(drCurrentRow);
ViewState["CurrentTable"] = dtCurrentTable;
return dtCurrentTable;
}
}
}
This code gives me the Fallowing Error:
Not all code paths return a value plss Help !!
|
|
|
|
|
insert return null; before the last }
|
|
|
|
|
Can SARIGÜL wrote:
insert return null; before the last }
not working actually
I want this Function result to be used as Datatable to fill a Gridview.
return null will work
|
|
|
|
|
The reason it's given you this message is because you have the condition to test if the ViewState is not null. What happens if ViewState["CurrentTable"] is null? (You have a similar issue if dtCurrentTable.Rows.Count == 0 . To fix this, return an empty DataTable from the method (most style guides recommend not returning null).
|
|
|
|
|
Add:
else
{
return null;
}
before last '}'.
|
|
|
|
|
I'm working on a program that will convert a wav-file to mp3, tag it and then upload it via FTP.
I'm done with the FTP-part and am now working on the converting to MP3 part (the only thing left).
The plan is to use LAME (lame_enc.dll) to do the encoding/converting (unless you have any other suggestion). But I've hit a snag.
I couldn't find any good examples for Lame & .NET. I found this here on TCP: C# MP3 Compressor[^]
It wouldn't compile due to missing form components, but I copied the the classes that's relevant.
The project compiles but I get an exception on the call to beInitStream (in the constructor of Mp3Writer). The error states:
PInvokeStackImbalance was detected
and that "the managed PInvoke signature didn't match the unmanaged target signature" (translated from Swedish).
Is there anyone that has an idea what's wrong?! Is this code written for an older version of lame_enc.dll (I've looked at the documentation, but can't see the problem)?
I also tried to use IntPtr etc (found in another example for another DLL), but same result:
Marshal.StructureToPtr(Marshal.SizeOf(m_Mp3Config), Marshal.AllocHGlobal(pConfig), false);
uint LameResult = Lame_encDll.beInitStream(ref pConfig, ref m_InputSamples, ref m_OutBufferSize, ref m_hLameStream);
Code for DLL import:
[DllImport("Lame_enc.dll")]
public static extern uint beInitStream(ref BE_CONFIG pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);
or
[DllImport("Lame_enc.dll")]
public static extern uint beInitStream(ref IntPtr pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);
I could just call lame.exe, but I don't want to do it, mainly because I want to report the progress.
Glad for any help/ideas!
|
|
|
|
|
Hi,
P/Invoke stack problems are caused by a calling convention mismatch. This[^] may help you.
|
|
|
|
|
A stack imbalance means either you passed the wrong number of parameters, or you used the wrong calling convention (which essentially amounts to the same thing underneath).
|
|
|
|
|
I can't see anything obviously wrong from what you've posted. I've had a quick look online at the C definition for the function and I would declare it like:
[DllImport("Lame_enc.dll")]
public static extern int beInitStream(ref BE_CONFIG config, out int samples, out int bufferSize, out IntPtr streamHandle);
I've used out rather than ref for the last 3 parameters as this[^] suggests that these values are returned by the function so no need to pass a reference in.
Edit: Be sure to check the return value from the function. It will be one of these constants:
public const int BE_ERR_SUCCESSFUL = 0x00000000;
public const int BE_ERR_INVALID_FORMAT = 0x00000001;
public const int BE_ERR_INVALID_FORMAT_PARAMETERS = 0x00000002;
public const int BE_ERR_NO_MORE_HANDLES = 0x00000003;
public const int BE_ERR_INVALID_HANDLE = 0x00000004;
public const int BE_ERR_BUFFER_TOO_SMALL = 0x00000005;
modified 29-May-12 7:49am.
|
|
|
|
|
Hi every one ,
It's really get's on my nerve ,I didn't get the problem with my code,please help.
Int32 i = Convert.ToInt32(lblmnum.Text);
Int32 j = Convert.ToInt32(lbljnum.Text);
Process[i][j] = Convert.ToInt32(txttimep.Text);
and I define the array before :
int[][] Process= new int[100][];
thank you all in advance
|
|
|
|
|
It looks like the second dimension of your int32 array isn't defined, so what do you expect? A two dimensional array is an array of arrays. You've declared an array with a hundred slots containing arrays with an unspecified array length.
Regards,
Manfred
|
|
|
|