|
when i click that linkbutton any file will download from db
|
|
|
|
|
OK. And the question is?
जय हिंद
|
|
|
|
|
Unfortunately for you the subject line does not support newline characters and the rest of my message can not be displayed
|
|
|
|
|
Hi:
Can anyone suggest a good source code arranger/formatter that works with C#?
It must be able to create regions using a defined logic and lots of code formatting options.
I have looked at NArrange (which looks great), but I can't seem to get my head around its configuration options
Thanks in advance,
Martin.
|
|
|
|
|
I am calling a C++ dll in C# code. The called function takes a 2 dimesnsional array but gives the follwoing error when the values are to be printed from the C++ code. The code snippets are attached below.
-------------------------------------------------------------------
"An unhandled exception of type 'System.AccessViolationException' occurred in Utility.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
-------------------------------------------------------------------
The DLL import function is as follows:-
[DllImport("ClusteringDLL.dll", EntryPoint = "?getdata@CClusteringDLL@@QAAXQAPAM0H@Z", CallingConvention = CallingConvention.Cdecl, SetLastError = true)]
public static extern void getdata([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, SizeConst=4)] float[,] dx, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, SizeConst=4)] float[,] dy, int it);
-----------------------------------------------------------------
The C++ function is as follows:-
CLUSTERINGDLL_API void __cdecl CClusteringDLL::getdata(float *dxm[], float *dym[], int s) //function for getting the data from user
//CLUSTERINGDLL_API void __ CClusteringDLL::getdata(float (&dxm)[Size][2]) //function for getting the data from user
//CLUSTERINGDLL_API void __thiscall CClusteringDLL::getdata(int dxm) //function for getting the data from user
{
std::cout<<"Enter the number of clusters";
std::cin>>numClust;
std::cout<<std::endl<<"Enter the number of points";
std::cin>>numPoints;
if (numPoints==numClust)
{
std::cout<<std::endl<<"Reenter the number of points as the number of points=number of clusters";
std::cin>>numPoints;
}
for(int i=0;i<=s;i++)
{
std::cout<<std::endl<<"X Co-ordinate:"<<dxm[i][0];
}
}
---------------------------------------------------------------------
The code throws the error when one tried to print the X co-ordinate as shown on the last line of the code.
-------------------------------------------------------------------
And the calling function in main is as fiollows:-
Dllc.getdata(dx, dy, it);
I have tried different calling conventions as well as different ways of writing the signature of the function. But the same error comes up. Any qucik help will be highly appreciated.
Regards
Amit
|
|
|
|
|
First ensure that it is working when called from C++.
My doubts are on the line
for(int i=0;i<=s;i++)
I guess it should be
for(int i=0;i<s;i++)
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Yes the code does run and it even prints value which is in the C++ code. It prints the 0th element of the x array as 0 which is wrong and then throws the error.
Regards
Amit
|
|
|
|
|
Hello all,
Im looking for some opinions and/or suggestions on the best way to handle file uploading and downloading to/from a server with my application.
At the moment I have implemented an FTP solution to allow files to be transfered to and from the server, this seems to be working fine but I am not sure if i have chosen the best option for the task (in terms of performance and reliability). I know it is possible to store files in an SQL database (which I am currently using for data storage), but avoided this approach as I didnt want to pack my database with file storage.
Can anybody offer an opinion on a 'best practice' route for this kind of functionality? or perhaps offer another alternative I could look into?
Im not completely against SQL storage if anyone can put a good argument forward for it? After all I just want wants best for my offsprings
Thanks
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
have you tried remoting? that would really help you to write codes to upload and down load files using a file system not the SQL server
|
|
|
|
|
Thanks for your reply
Have been looking at 'C# Remoting' and have a found a few articles with varying approaches to how to acheive a file upload/download system. Though all of them (of the ones i looked at) seem to require a server-side application. Something I was hoping to avoid using.
Is this the idea you had in mind? i.e. creating a server app and communicating with that for file transfers
Also where you thinking of any perticular method, like using the System.Runtime.Remoting classes, or was your suggestion just for a general remoting solution?
Either way thanks for the suggestion, has been interesting to read about, but like I said, I want to avoid creating a server app if possible
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
yeah!! you would need a server app to achieve what you are looking for in remoting. it's not at all complicated though, you will have more control over the transer as well among other benifits.
I would recommend "Wrox Press-Professional C#" book,
Good Luck
|
|
|
|
|
Hi everybody.
Maybe some of you have better experience with the Sync Framework than I have. I am trying to sync an XML file and some images between my desktop and a PDA, using C#.
I saw there is a sample of using Microsoft Sync Framework with a device, but it uses Web Services and I would very much prefer to do without those. I already built a .Net Framework 3.5 C# Windows Forms Application and a similar thing (3.5) on the Mobile device. Do you think it is possible to use WCF or SyncFramework to get some files Desktop <-> PDA?
Thank you for your time ::- ) !
|
|
|
|
|
The project "aa.mpp", the other project "master.mpp".
1.I open the "master.mpp"
2.select "Insert->Project"
3.select "aa.mpp",
4."aa.mpp" has been add into "masther.mpp"
How to finish above funtion by coding.
Thanks all
|
|
|
|
|
why do yopu want to do this??
do you want to use the functionalities defined in aa.mpp in your master.mpp??
|
|
|
|
|
|
I've not done any coding with Project but have had some success using Excel and Word etc. A good place to start would probably be MSDN: Project Solutions[^]
At first glance, the documentation looks pretty thin so you might have a bit of a job ahead - good luck!
It definitely isn't definatley
|
|
|
|
|
Special thanks for your naswer
|
|
|
|
|
Hi,
In my C#.Windows app.I want print a slip of size of width 55mm and height 45 mm.
I am using crystal Reports printing this width and height text.I am using Canon printer.
In crystal Reports Only The 'Card'Size which takes 148*125 mm.And there is no option in
printer also.It prints same 55 and 45 mm text.But printed paper is bit lentheier than test. So is there any way that can i fix through by writing code.
please....
|
|
|
|
|
Ah a new homework topic?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
how to set custom paper size of crystal report programatically using c#
|
|
|
|
|
Hi
I have a gridview, dgvDepartments linked to a dataset, dsDepartments.
bool InitialiseDepartments()
{
rmDepartments = (IUserList)Activator.GetObject(typeof(IUserList),
System.Configuration.ConfigurationManager.AppSettings
["UserListUrl"]);
try
{
dsDepartments = null;
dsDepartments = rmDepartments.GetDepartments();
bsDepartments.DataSource = dsDepartments;
bsDepartments.DataMember = "Departments";
dgvDepartments.DataSource = bsDepartments;
dgvDepartments.Refresh();
}
catch (Exception ex)
{
ShowError("Unable to load Departments. " +
"Server possibly not running. \n\n" +
"System Error: " + ex.Message);
return false;
}
return true;
}
If I make changes to the gridview and click SaveChages, the changes are saved.
If I then make more changes, when I click SaveChanes, it reports No changes to save. This is from the code:
Validate();
BindingContext[dsDepartments, "Departments"].EndCurrentEdit();
DataSet changes = dsDepartments.GetChanges();
if(changes != null)
which resolves to false. To me, this means that the link between the gridview and the dataset has gone. Here is the code that executes when a change is saved (Without try blocks and error handling):
dsDepartments.AcceptChanges();
dsDepartments = null;
dsDepartments = rmDepartments.GetDepartments();
dgvDepartments.Refresh();
I can't find any changes to gridview datasource and the like, but once I have saved a change, changes in the gridview are no longer reflected in the dataset.
I can't think what value I should monitor to see where the link gets broken.
|
|
|
|
|
Well I'm not quite sure of the solution but I think when you make changes and use the DataSet.AcceptChanges() the positions in the BindingContext will not be set properly..I guess you have to set the position using BindingManagerBase so as to reset the cursor to starting row... Try google on this...
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
I have the following snippets in an MDI form and a child
MDI
private void mnuFileNew_Click(object sender, EventArgs e)
{
frmAddItem addItem = new frmAddItem();
addItem.MdiParent = this;
addItem.ShowInTaskbar = false;
addItem.Show();
}
Child
private void frmAddItem_Load(object sender, EventArgs e)
{
GetEnumerations();
BindCombos();
int maxLength = int.Parse(RegistryHelper.ReadSettingFromRegistry(@"Inventory\Barcode\C39\Length"));
txtBarcode.MaxLength = maxLength;
}
Now, the funny part is that the moment the debugger reaches the
GetEnumerations() in the child's load section, the code just exits the event handler back to the parent. Anyone have a clue why? I'll add to the plot and say that the last line references a dll that reads a value from the registry. Works like a swiss watch but the GetEnumerations method which reads from the DB doesn't seem to function.
|
|
|
|
|
Strange
I assume you've set a breakpoint at BindCombos(); and it's never reached?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Yep. I've tried restarting the IDE and the computer but still the same.
|
|
|
|