|
hi
i have a code that does not response
dataGridview1.DataSource = dataset1;
i`m sore that dataset is fill
and when i use following code dbgrid creates as same record number as exist
in dataset but the value of rows in dbgrid are empty
dataGridview1.DataSource = dataset1.Tables[0];
|
|
|
|
|
Hi,
try to use the datagridview1.DataBind() method to finally bind the dataset to the datagridview.
Regards
Sebastian
|
|
|
|
|
Hi,
That´s not working? error not there
reza assar wrote: dataGridview1.DataSource = dataset1.Tables[0];
Datatable as to be empty! if you have only 1 databable in the dataset, just create the table. Bellow i didn´t create a dataset.
Change the routine code to fit your demands.
public static void DataGridView_Fill(DataGridView dgv, string store_procedure)
{
SqlConnection sql_conn = new SqlConnection(connection_string);
SqlCommand sql_cmd = new SqlCommand();
sql_cmd.Connection = sql_conn;
sql_cmd.CommandText = store_procedure;
sql_cmd.CommandType = CommandType.StoredProcedure;
sql_conn.Open();
SqlDataAdapter sql_da = new SqlDataAdapter();
sql_da.SelectCommand = sql_cmd;
DataTable dt = new DataTable();
sql_da.Fill(dt);
sql_conn.Close();
dgv.DataSource = dt;
}
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
hi
what can i do to have a shortcut for click event of a LinkLabel
|
|
|
|
|
Shortcut to what?
Web page / program etc... use System.Diagnostics.Process.Start method.
[Edit]The tag property of the linklabel can be a useful place to store your URL or path etc... you'll have to cast back to string to retrieve the data.[/Edit]
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)
|
|
|
|
|
Im generating a Pdf of a table that contains about 200 000 records, each containig a differen image file too. so my pdf has to draw 200 000 little images, i get out of memory erro or GDI+ error after a while. The code does work for less records (checked on 100 - 1000). the code also works if I delete the image = new PdfBitmap("path for a different image for every cell of the table"); line and draw the same image in every row.
Please any suggestions would be appreciated.
public PdfImage image = new PdfBitmap("l.jpg");
void table_EndCellLayout(object sender, EndCellLayoutEventArgs args)
{
int cellIndex = args.CellIndex;
if ((cellIndex == 5) )
{
PdfGraphics g = args.Graphics;
try
{
image = new PdfBitmap("path for a different image for every cell of the table");
RectangleF bounds = args.Bounds;
PointF point1 = bounds.Location;
//obliczanie srodkowego punku komorki
g.DrawImage(image,point1.X, point1.Y, 30, 30);
}
catch
{
}
}
}
|
|
|
|
|
You should be disposing of any 'new' disposable instances you create, ie PdfBitmap.
That said, I have never seen that class, and there could be other issues involved.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - coming soon ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I have tried that but maybe Im not doing it right
I cant do image.dispose(). tried
image=null;
and then calling garbage collector..
Im a begginer c# programmer, pls could u write the ideas u have in code?
|
|
|
|
|
hello,
i want to show 5 days before current date and 20 days after current date in a calender control with every date link to a particular page.
plz give me any sample code.
regards
aurosikha
|
|
|
|
|
Windows Forms does not have a Calender control (it does have DateTimePicker), so I suggest you head off to the ASP.NET message board.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - coming soon ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I know how to insert images to PDF but i need to how can we insert image and image name below it in PDF using C# or Vb or VB.net
RamyaNaidu
|
|
|
|
|
Contact the supplier of your PDF library.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - coming soon ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
|
Use an interface. Simple example below.
public interface IMyInterface
{
void WriteMe();
}
public class A : IMyInterface
{
public void WriteMe()
{
Console.Write("A");
}
}
public class B : IMyInterface
{
public void WriteMe()
{
Console.Write("B");
}
}
public class C : IMyInterface
{
public void WriteMe()
{
Console.Write("C");
}
}
public class D
{
public void WriteParameter(IMyInterface test)
{
test.WriteMe();
}
}
Then you can do this
D d = new D();
d.WriteParameter(new A());
d.WriteParameter(new B());
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)
|
|
|
|
|
Thanks a lot Dave this code worked for me.
|
|
|
|
|
If I understand what you want (and I probably don't), what you want to do is called oveloading.
public class A
{
private List<a> list = new List<a>();
public List<a> GetAllRecords() { get { return list; } }
}
public class B
{
private List<b> list = new List<b>();
public List<b> GetAllRecords() { get { return list; } }
}
public class C
{
private List<c> list = new List<c>();
public List<c> GetAllRecords() { get { return list; } }
}
public class D
{
private A a = new A();
private B b = new B();
private C c = new C();
private List<a> aList;
private List<b> bList;
private List<c> cList;
public D()
{
}
private List<a> GetAllRecords(A a)
{
aList = a.GetAllRecords;
}
private List<b> GetAllRecords(B b)
{
bList = b.GetAllRecords;
}
private List<c> GetAllRecords(C c)
{
cList = c.GetAllRecords;
}
}
[EDIT] Forgot to convert the pointy brackets...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Saturday, October 11, 2008 5:08 AM
|
|
|
|
|
Hello friends,
I'm using Visual Studio 2005. I'm developing an application that extracts icons from .exe and .scr files and saves them into a MS-Access database. I've created a OLE Object field in the database table for the icons. I use the Icon.Save() along with an instance of the MemoryStream class to get raw icon data bytes into an array. My problem is that Icon.Save() method saves the icon as a 16-color image. I want to know how can I save the icon with no quality loss.
Also, are there any alternatives to the MemoryStream class?
Many thanks in advance.
|
|
|
|
|
hi
this is a good example for loading and saving icons.
http://www.codeproject.com/KB/cs/IconLib.aspx
regards
|
|
|
|
|
Can any body in which situations we use value type and for which situations we use reference types for passing parameters to function.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
i think when u have simply to do some calculations or just require temprerory variable to do ur oprations then u can go for value type
and if u want to reuse the same object among diffrent functions which have
dependency on operation done on that object by other funcions then u should go for reference type.
rahul
|
|
|
|
|
If you want the value from outside the function to be changed within the function, use a reference type.
If you want to pass a value from outside the function but not let the function change the original then it needs to be a value type or a clone of the reference type.
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)
|
|
|
|
|
Hi Dave,
If i pass parameter as reference type, for eg. if i pass every thing as ref type then is i am saving memory because no extra memory is required in heap , if i pass parameter as ref.
Tell me i am correct or not.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
I'm no expert in stack/heap stuff, so if what I type below is erroneous, would one of the CP gurus please correct it!
Value types are placed on the stack, reference types are placed on the heap but the reference to them are placed on the stack. A method's parameters are placed on the stack - either a copy of the value type, or a copy of the reference to the reference type, therefore the heap doesn't come into the equasion at all.
Extra stack space is taken whichever way you do it. Reference will be more efficient if you would otherwise be passing large structs (value types), but the stack is very efficient so I wouldn't worry too much.
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)
|
|
|
|
|
You inspired me to read up on this a little!
This[^] is a well explained article. Hope you find it to be of some use.
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)
|
|
|
|
|
This article supports that if you pass very big collection then u should pass by reference.
Am I rite.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|