|
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
|
|
|
|
|
thank you so much,I'm new in c#.
at first I try to define it as simple as c.
it works thanks.
|
|
|
|
|
|
Try This
and then use
Initialize array
Int32[,] Process = new Int32[5,5];
Int32 i = Convert.ToInt32("1");
Int32 j = Convert.ToInt32("1");
Process[i,j] = Convert.ToInt32("45");
|
|
|
|
|
hi
how cam i create database(sql server .net ) on wp7 ?
i want ask ...can i crate database as visual studio through server explorer button this button not appear on visaul studio for wp7
|
|
|
|
|
You can't host SQL Server on WP7. If you need SQL Server capabilities, you will have to use web services and host the database on the server end.
|
|
|
|
|
heba abu ghaleih22 wrote: how cam i create database(sql server .net ) on wp7
Just to verify you did mean Windows Phone 7 right?
As per the other response you would not typically attempt to put a 'server', regardless of the type, on a phone.
If you really just want persistence then you might want to look at an object database which can be embedded in your app. Along those lines you could look at RavenDB (I am not recommending that but merely noting that it exists and there are probably others.)
|
|
|
|
|
yes i mean windows phone 7
i done database on server tcp (done in c# program )
but i want to another DB for client wp7 so what type of database can i use ?
when search on google i found this ( Sqlite Client for Windows Phone ) and i found (Using Local Database in WP7-Mango) so whaat i can use for tcp client ?
|
|
|
|
|
Your question isn't clear.
If you want a SERVER, then you find a box, put a database on it, and maintain it.
Then your CLIENT talks to it, which means TCP. And it doesn't matter much what the client box is as long as you can write code that talks to the server.
However if you want persistence on the phone ITSELF, then you do not need a client-server solution.
|
|
|
|
|
Hi, is it possible to edit pdf files using csharp? (Eg: Putting notations on it, change text...) I need a library (.dll) Thx.
|
|
|
|
|
|