|
hai Friends
Pls Solve my problem,How retrieve the image in sql to image control,pls help me.
i use c# project but i dont know the c# language,so give me a solution how retrieve the image.......
Hai Friends
|
|
|
|
|
|
I want to use RadioButton in DataGridView but I do not how to do that.
I just need a very simple Class for getting/setting its Checked state true/false.
That is all I need for this control.
Please help me to that. It is urgent
Thanks in advance
Best Regards,
pvphuc
|
|
|
|
|
According to your question, I hope this article willl help: Build a Custom RadioButton Cell and Column for the DataGridView Control. You can also download the code samples for the project.
Windows Forms 2.0 offers several cell and column types for its DataGridView control. For example, the product ships with a text-box–based cell and column (DataGridViewTextBoxCell/DataGridViewTextBoxColumn) and a check-box–based duo (DataGridViewCheckBoxCell/DataGridViewCheckBoxColumn) among others. Even though the product comes with a rich set of cell and column types, some developers may want to create their own cell and column types to extend the functionality of the grid. Thankfully the DataGridView control architecture is extensible enough that such custom cells and columns can be built and used in the grid. This document explains how to create and use a cell and column that easily let the user pick an entry among multiple choices.
http://msdn2.microsoft.com/en-us/library/aa730882(vs.80).aspx
SSK.
|
|
|
|
|
Thanks Vri SSK
I have read that article but it is so complex.
I just need a very simple class for my work. It is always display on the cell
and user can check it.
Could you give me another solution.
Thanks so much
pvphuc
|
|
|
|
|
That sample is about as simple as it gets for what you said you want to do. There is no "very simple" way to do this.
|
|
|
|
|
The simple way is that, but is not a proper way u can add the asp.net label control in the gridview column and in the event of databinding of gridview u can write html (
|
|
|
|
|
But I am working with Window Form not Web Form.
|
|
|
|
|
Please see the following code snippet
class BaseClass
{
public virtual void SampleFun()
{
Console.WriteLine("In base class SampleFun");
}
}
class ChildClass : BaseClass
{
public override void SampleFun()
{
Console.WriteLine("In child class samplefun");
}
}
class GrandChild : ChildClass
{
public GrandChild()
{
Console.WriteLine("Grandchild contructor");
base.SampleFun();
}
}
From grandchild class I am able to call the Child classes overrided method. But how to call BaseClass original method from GrandChild class ? When I try to call this.SampleFun() , VS editor shows two overloaded method. But I am able to call only ChildClass SampleFun() method. Is there any way to call BaseClass SampleFun() method.
|
|
|
|
|
base.base.SampleFun();
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: base.base.SampleFun();
Thanks christian. But this won't work.. I tried. MSDN say's it is not possible to do what I asked. Do you have any suggestions ?
|
|
|
|
|
OK, I thought that worked. Try somethng like
Base base = this;
That would do it, I would expect. i.e. create an instance of the bottom level class to call.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: OK, I thought that worked. Try somethng like
Base base = this;
I feel base is reserved word. It is not allowing me to do this. So I tried something like this
BaseClass base1 = this;
base1.SampleFun();
This compiled without producing any error. But in runtime, it called child classes overrided SampleFun() method.
|
|
|
|
|
It doesn't matter how you cast the reference, the virtual method is called for the actual class of the instance. That is the purpose of virtual methods.
---
single minded; short sighted; long gone;
|
|
|
|
|
That's impossible. As the method in the base class is overridden, it doesn't exist at all in the child classes.
Virtual methods is called using the virtual method table for the actual class of the instance. The method in the base class only exists in the virtual method table for the base class, so you need an instance of that class to call that method.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks Guffa for making that clear. I tried with martins suggestion, and it worked.
|
|
|
|
|
Hello,
I think, In this case only a trick could work:
class BaseClass
{
public virtual void SampleFun(bool TakeBase)
{
Console.WriteLine("In base class SampleFun");
}
}
class ChildClass : BaseClass
{
public override void SampleFun(bool TakeBase)
{
if(TakeBase)
{
base.SampleFun(TakeBase)
}
else
{
Console.WriteLine("In child class samplefun");
}
}
}
class GrandChild : ChildClass
{
public GrandChild()
{
Console.WriteLine("Grandchild contructor");
base.SampleFun(true);
base.SampleFun(false);
}
}
Never tested it! (maybe it's like Guffa sayed bevor)
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hello martin,
Excellent...Yes your trick clicked. It worked.. Thanks.
|
|
|
|
|
Glad, I could help!
All the best,
Martin
|
|
|
|
|
some kind of very ugly hack.
I think that the underlying problem lies within the class design. Why to call the method of the BaseClass when the GrandChild is actually a Child. This doesn't make any sense to me. Luckily, it isn't me that has to maintain this code
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
What are the possibilities for the following error ' Exception has been thrown by the target of an invocation ' in C#.net
|
|
|
|
|
This is generally a remoting related error.
|
|
|
|
|
Ilango Gandhi wrote: What are the possibilities for the following error ' Exception has been thrown by the target of an invocation ' in C#.net
Almost anything. It means that you have called a method using Invoke , and during the execution of that method an exception occured.
Examine the InnerException property of the exception that you got. That will contain the exception that occured in the call.
---
single minded; short sighted; long gone;
|
|
|
|
|
You also get this error when an exception occurs in a Background Worker
|
|
|
|
|
Hi All,
Iam using 3 tier architecture.Now what iam doing is i written database related things into DAL.Now i want to access these class and methods into
BLL.After that iam accessing BLL classes into my GUI.But here it is showing this error
Type Load Exception Was Unhandled by User Code
Could not load type 'DAL.JoDetailsDAL' from assembly 'DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Here is My DAL Code file
JoDetailsDAL.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Data.SqlClient;
namespace DAL
{
public class JoDetailsDAL
{
CommonDAL objCommonDAL = new CommonDAL();
public SqlDataReader getcustomer(ref string errorMsg)
{
string strSelect = "select CustomerName from cm_tb_032";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader getvendor(ref string errorMsg)
{
string strSelect = "select VendorName from cm_tb_033";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader getvendorcity(ref string errorMsg)
{
string strSelect = "select VendorCity from cm_tb_034";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader getvendorstate(ref string errorMsg)
{
string strSelect = "select VendorState from cm_tb_035";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader getjostatus(ref string errorMsg)
{
string strSelect = "select Status from cm_tb_036";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader getamendmentstatus(ref string errorMsg)
{
string strSelect = "select AmendmentStatus from cm_tb_038";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader getdeliveryschedule(ref string errorMsg)
{
string strSelect = "select DelSchedule from cm_tb_039";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
public SqlDataReader termsofpayment(ref string errorMsg)
{
string strSelect = "select TermsOfPayment from cm_tb_040";
return objCommonDAL.getDataReader(strSelect, ref errorMsg);
}
}
}
Here is My BLL Code
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Sql;
using System.Data.SqlClient;
using DAL;
namespace BLL
{
public class JoDetailsBLL
{
JoDetailsDAL objJoDetailsDAL = new JoDetailsDAL();
public SqlDataReader getcustomer(ref string errorMsg)
{
return objJoDetailsDAL.getcustomer(ref errorMsg);
}
public SqlDataReader getvendor(ref string errorMsg)
{
return objJoDetailsDAL.getvendor(ref errorMsg);
}
public SqlDataReader getvendorcity(ref string errorMsg)
{
return objJoDetailsDAL.getvendorstate(ref errorMsg);
}
public SqlDataReader getvendorstate(ref string errorMsg)
{
return objJoDetailsDAL.getvendorstate(ref errorMsg);
}
public SqlDataReader getjostatus(ref string errorMsg)
{
return objJoDetailsDAL.getjostatus(ref errorMsg);
}
public SqlDataReader getamendmentstatus(ref string errorMsg)
{
return objJoDetailsDAL.getamendmentstatus(ref errorMsg);
}
public SqlDataReader getdeliveryschedule(ref string errorMsg)
{
return objJoDetailsDAL.getdeliveryschedule(ref errorMsg);
}
public SqlDataReader termsofpayment(ref string errorMsg)
{
return objJoDetailsDAL.termsofpayment(ref errorMsg);
}
}
}
Here is my GUI Code file
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Reflection;
using BLL;
public partial class JoDetails : System.Web.UI.Page
{
JoDetailsBLL objJoDetailsBLL = new JoDetailsBLL();
string errorMsg = null;
protected void Page_Load(object sender, EventArgs e)
{
getcustomer();
getvendor();
getvendorcity();
getvendorstate();
vendorinvoicecity();
vendorinvoicestate();
jopartcity();
joshipcity();
joshipstate();
jostatus();
joamendmentstatus();
getdeliveryschedule();
termsofpayment();
}
public void getcustomer()
{
SqlDataReader dr = objJoDetailsBLL.getcustomer(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoCustomerLst.DataSource = dr;
JoCustomerLst.DataTextField = "cust_name";
JoCustomerLst.DataBind();
}
}
public void getvendor()
{
SqlDataReader dr = objJoDetailsBLL.getvendor(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoVendorLst.DataSource = dr;
JoVendorLst.DataTextField = "vendor_name";
JoVendorLst.DataBind();
}
}
public void getvendorcity()
{
SqlDataReader dr = objJoDetailsBLL.getvendorcity(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoVendorCityLst.DataSource = dr;
JoVendorCityLst.DataTextField = "vendor_city";
JoVendorCityLst.DataBind();
}
}
public void getvendorstate()
{
SqlDataReader dr = objJoDetailsBLL.getvendorstate(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoVendorStateLst.DataSource = dr;
JoVendorStateLst.DataTextField = "vendor_state";
JoVendorStateLst.DataBind();
}
}
public void vendorinvoicecity()
{
SqlDataReader dr = objJoDetailsBLL.getvendorcity(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoInvoiceToCityLst.DataSource = dr;
JoInvoiceToCityLst.DataTextField = "vendorinvoice_city";
JoInvoiceToCityLst.DataBind();
}
}
public void vendorinvoicestate()
{
SqlDataReader dr = objJoDetailsBLL.getvendorstate(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoInvoiceToStateLst.DataSource = dr;
JoInvoiceToStateLst.DataTextField = "vendorinvoice_state";
JoInvoiceToStateLst.DataBind();
}
}
public void jopartcity()
{
SqlDataReader dr = objJoDetailsBLL.getvendorcity(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoParCityLst.DataSource = dr;
JoParCityLst.DataTextField = "jopart_city";
JoParCityLst.DataBind();
}
}
public void joshipcity()
{
SqlDataReader dr = objJoDetailsBLL.getvendorcity(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoShipToCityLst.DataSource = dr;
JoShipToCityLst.DataTextField = "joship_city";
JoShipToCityLst.DataBind();
}
}
public void joshipstate()
{
SqlDataReader dr = objJoDetailsBLL.getvendorstate(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoShipToStateLst.DataSource = dr;
JoShipToStateLst.DataTextField = "joship_state";
JoShipToStateLst.DataBind();
}
}
public void jostatus()
{
SqlDataReader dr = objJoDetailsBLL.getjostatus(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoStatusLst.DataSource = dr;
JoStatusLst.DataTextField = "joship_status";
JoStatusLst.DataBind();
}
}
public void joamendmentstatus()
{
SqlDataReader dr = objJoDetailsBLL.getamendmentstatus(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoAmendStatusLst.DataSource = dr;
JoAmendStatusLst.DataTextField = "amendment_status";
JoAmendStatusLst.DataBind();
}
}
public void getdeliveryschedule()
{
SqlDataReader dr = objJoDetailsBLL.getdeliveryschedule(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoDeliveryLst.DataSource = dr;
JoDeliveryLst.DataTextField = "delivery_schedule";
JoDeliveryLst.DataBind();
}
}
public void termsofpayment()
{
SqlDataReader dr = objJoDetailsBLL.termsofpayment(ref errorMsg);
if (dr == null)
{
errorLbl.Text = errorMsg;
errorLbl.Visible = true;
}
else
{
JoTermsOfPayLst.DataSource = dr;
JoTermsOfPayLst.DataTextField = "terms_payment";
JoTermsOfPayLst.DataBind();
}
}
}
Please help on this .
veeresh
|
|
|
|