|
anybody give me code for this
|
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
try
{
foreach (GridViewRow gvr in gvWorkGroup.Rows)
{
new StockInformation_FK().SaveItemes(txtItemId.Text, ddlCatagoryName.SelectedValue, ddlSupplierName.SelectedValue, ddlBrand.SelectedValue, txtItemName.Text, txtPartNo.Text, txtSerialNo.Text, ddlStatus.SelectedValue, txtPrice.Text, dtPurchase.Text, dtWarranty.Text, txtInvoiceNo.Text, txtRemarks.Text, "");
}
ShowSuccesMessage(LoadSucessMsg());
ClearAll();
LoadGrid();
}
catch (Exception ex)
{
throw ex;
}
}
}
modified on Thursday, September 15, 2011 5:43 AM
|
|
|
|
|
Is there any way to find which all .lib, .dll etc files are included in a exe ?
or
Is there any way to find which all .lib, .dll etc files are included in a .lib ?
RKP
|
|
|
|
|
I used dumpbin.exe but its not verbose.
RKP
|
|
|
|
|
When a PDF file gets downloaded in temporary Internet files while it is opened on browser.
How can I get the time taken for PDF getting downloaded.
upto this, the main should be stopped until PDF file gets fully downloaded. How to fix it?
|
|
|
|
|
Not sure what you mean by 'the main should be stopped' but you probably want to ask in the ASP .Net forum (as this isn't really a C# question)
I'd guess, though, that you'd have to write some javascript to trigger from the client when downloading is complete - and my guess would be that this might be very client dependent.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi,
I created a simple C# program that imports a dll (Unmanaged dll), which a coworker wrote, the dll references other managed dll's (kernel32.dll,...etc) . On the PC i built the app on everything works great ( /bin/Debug/test.exe Folder), as well the unmanaged dll resides in the same folder as the .exe.
I published the app and ran it on another PC and i receive an error " Unable to load DLL "DSVR.dll" ..." Details
************** Exception Text **************
System.DllNotFoundException: Unable to load DLL 'DSVR.dll': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
at DSVR_CSharpExample.DSVR.DSVR_Open()
at DSVR_CSharpExample.Form1.Form1_Load(Object sender, EventArgs e) in C:\Program Files\H&E\DSVR_CSharpExample\Form1.cs:line 127
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I installed the same version of .net, Redistribution 2008 SP1, Powerpacks, etc.. i ran dependency walker and everything traced out fine.
Any Suggestion on What am i doing wrong (I've been trying to figure this out for 2 days) ?
Namespace DSVR_CSharpExample
{
public static class DSVR
{
[DllImport("DSVR.dll", EntryPoint = "DSVR_Open")]
public static extern IntPtr DSVR_Open();
[DllImport("DSVR.dll", EntryPoint = "DSVR_Close")]
public static extern void DSVR_Close(IntPtr ConnectionHandle);
.
.
.
.
Much appreciated,
Matt
|
|
|
|
|
Hi Matt,
the unmanaged DLL might need other unmanaged DLLs and be unable to find them; that would result in the error message you are getting (it is regrettable the message Windows provides isn't more specific).
Two likely causes:
1. those DLLs are simply not present (e.g. debug versions of the C run-time library, part of Visual Studio, and not present on other PCs). The easiest solution then is to release-build the native app.
2. those DLLs are present but the folder that contains them is not part of your PATH environment variable. If so, fix the PATH.
|
|
|
|
|
Hi Luc, thanks for the response.
All the DLL's are present (according to dependency walker). I've updated the PATh environment variable and the same issue is happening. As a test i installed VS 2008 on the client PC and the app runs (If finds all the dlls), i have a strong feeling it's some sort of pathing issue, does that seem right? (I can't leave VS on the client machine).
-md
|
|
|
|
|
It's possible that those machines do not have the managed DLL's that are being referenced. Are you able to check that those machines have all required DLL's? ...Just a suggestion..
Jay.
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
Hi Jay,
The machines have the dlls that's what i don't get (Dependency walker maps out correctly). As a test i installed VS2008 on the machine, and the app ran. What am i missing here ? In my import
[DllImport("DSVR.dll", EntryPoint = "DSVR_Open")]
is it possible to import from a static location ex. [DllImport("C:\Windows\Systems32\DSVR.dll", EntryPoint = "DSVR_Open")] ??
Thanks
-md
|
|
|
|
|
I tried setting my DllImport to [DllImport(@"C:\Windows\System32\DSVR.dll", EntryPoint = "DSVR_Open")] , thinking that may work, but on the client end i get :
System.DllNotFoundException: Unable to load DLL 'C:\Windows\System32\DSVR.dll': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
at DSVR_CSharpExample.DSVR.DSVR_Open()
at DSVR_CSharpExample.Form1.Form1_Load(Object sender, EventArgs e) in D:\Program Files\Integral\VideoSDK\samples\DSVR Export\Form1.cs:line 127
|
|
|
|
|
What version of VS was DSVR built on? You might need to install the appropriate version of the C++ redistributable (VS 2008 C++ redistributable[^]) on a machine without VS.
[EDIT : ok, didn't read your question fully.]
Can you get an unmanaged app to load the DLL?
|
|
|
|
|
I am trying to drag and drop from a picturebox to a desktop.. I am able to drag files from the desktop or folders to the picturebox but not the other way around.
this is what I have:
private void pictureBoxPicture_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
DataObject fileDragData = new DataObject();
fileDragData.SetData(DataFormats.FileDrop, pictureBoxPicture.Image);
DoDragDrop(fileDragData, DragDropEffects.All);
}
}
I can't seem to find much on google that I either understand or it works..
|
|
|
|
|
Hi everybody
after a lot of weeks about update related tables in database in a single transaction and configuring TableAdapters with stored procedures for CRUD operations, and having many trouble with TableAdapterManager.UpdateAll method to do this (see this post), i decide write some tricky code to do this myself and i put this code here for discussion :
Note : i have 2 tables, Customers & Orders. The Customers table is a parent of Orders table
TestDataSet ds = new TestDataSet();
private void toolStripButton1_Click(object sender, EventArgs e)
{
if (ds.Customers.GetChanges() != null || ds.Orders.GetChanges() != null)
{
using (SqlConnection con = new SqlConnection(Properties.Settings.Default.TestConnectionString))
{
SqlTransaction tr = null;
try
{
if (con.State != ConnectionState.Open)
con.Open();
tr = con.BeginTransaction();
if (ds.Customers.GetChanges() != null)
{
TestDataSetTableAdapters.CustomersTableAdapter customersAdapter = new TransactionalUpdate.TestDataSetTableAdapters.CustomersTableAdapter();
customersAdapter.Connection = con;
customersAdapter.Adapter.InsertCommand.Transaction
= customersAdapter.Adapter.UpdateCommand.Transaction
= customersAdapter.Adapter.DeleteCommand.Transaction = tr;
customersAdapter.Update(ds.Customers.GetChanges() as TestDataSet.CustomersDataTable);
}
if (ds.Orders.GetChanges() != null)
{
TestDataSetTableAdapters.OrdersTableAdapter ordersAdapter = new TransactionalUpdate.TestDataSetTableAdapters.OrdersTableAdapter();
ordersAdapter.Connection = con;
ordersAdapter.Adapter.InsertCommand.Transaction
= ordersAdapter.Adapter.UpdateCommand.Transaction
= ordersAdapter.Adapter.DeleteCommand.Transaction
= ordersAdapter.Adapter.DeleteCommand.Transaction = tr;
ordersAdapter.Update(ds.Orders as TestDataSet.OrdersDataTable);
}
ds.Customers.AcceptChanges();
ds.Orders.AcceptChanges();
tr.Commit();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
tr.Rollback();
}
finally
{
if (con.State != ConnectionState.Closed)
con.Close();
}
}
}
}
what about u ?
Is this code good ?
do u have idea to optimize this code ?
Thanks.
|
|
|
|
|
hdv212 wrote: Is this code good
Don't know. Can't be bothered to read it.
hdv212 wrote: do u have idea to optimize this code ?
Does it work? Yes, then don't bother.
If you think the code is good, then write an article, about what led you to write it this way, the mistakes you made on the way and so on.
But well done for persevering with it.
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.”
|
|
|
|
|
Hi Henry
It works good, but i think it can be optimize.
do u have any idea ?
|
|
|
|
|
Hello, one of the tasks in my current project is to read a set of networked Konica Minolta printers to get the count of total number of prints and copies made in that printer. I'd appreciate if anybody can share their idea on how this can be done.
Thanks in advance!!
|
|
|
|
|
You might get lucky and someone here might by chance know the answer to this, but I would think you are more likely to get useful information on the Minolta site.
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.”
|
|
|
|
|
Henry, thanks for your response
|
|
|
|
|
Requirement: ServerName and InstanceName to be displayed in a ToolPart
Data: The classes required to retrieve the DataSource(this contains the server name and instance name used in the connection string) using ASP.NET are, SqlConnection, SqlCommand
Solution:
public string RetrieveDataSource<br />
{<br />
get<br />
{<br />
SqlConnection sqlConnection = new SqlConnection(this.CurrentConnectionString);<br />
SqlCommand sqlCmd = new SqlCommand();<br />
sqlConnection.Open();<br />
sqlCmd.Connection = sqlConnection;<br />
return "Server Name :" + sqlCmd.Connection.DataSource;<br />
}<br />
}
Conclusion: The above code returns the DataSource in the following format “MyServerName\SQLInstanceName”
Swetha
modified on Tuesday, April 28, 2009 3:49 PM
|
|
|
|
|
is there a question in there or is this an FYI post?
|
|
|
|
|
I think the Articles section is a better place for this post...
This is a forum: questions>answers...
Therefore, if you already have the connection string(this.CurrentConnectionString), why make all coding just to extract the server name???
|
|
|
|
|
Hello,
I am having problems formatting data in a datagridview and I am hoping someone out there can help me. How can I format data by column in a datagridview skipping the first row and beginning at the second row?
Thank you for reading.
|
|
|
|
|
Why don't you just create an empty first row?
Normally you would do something like:
DataGridViewRow dgvr = dgvPowerSavingsReport.Rows[dgvPowerSavingsReport.Rows.Add()];
instead do:
<br />
dgvPowerSavingsReport.Rows.Add()<br />
<br />
DataGridViewRow dgvr = dgvPowerSavingsReport.Rows[dgvPowerSavingsReport.Rows.Add()];<br />
Hogan
|
|
|
|