, i m getting the inforamtion of SelectAllUser from DB and shown it into DATAGRIDVIEW , now i want to edit perticuler coulm of DGV after editing the desired value should be updated .how it will done i dont know ,any HELP WILL BE appreciated...
Here is code
private void cbxUserStatus_SelectedIndexChanged(object sender, EventArgs e)
string constr = ConfigurationManager.ConnectionStrings["RegistrationDB"].ConnectionString;
SqlConnection objcon = new SqlConnection(constr);
SqlDataAdapter da = new SqlDataAdapter("select * from tblRegistration where tblRegistration.userSta='1'", objcon);
DataTable dt = new DataTable();
dgvRegistration.DataSource = dt;
Note : please be precise while code as i m new to coding . |Code should be simple and fully functional
I've never worked with that SHDocVw library. From the error message, I can see that the Document property of SHDocVw.InternetExplorer is an object only. Before you can navigate further to its ActiveElement property, you have to cast it to an appropriate type (and likely again for ActiveElement). For that purpose, you have to read the documentation for that library - I do not know it!
Your code should then be something like (replace the dummy types I used!):
DocumentType document = ie.Document as DocumentType;
ActiveElementType activeElement = document.ActiveElement as ActiveElementType;
textBox1.Text = activeElement.InnerText;
Microsoft's Remote Connectivity Analyzer tool (https://testconnectivity.microsoft.com/) is great to troubleshoot Exchange. Does any body know if there's a way to get save the analysis results automatically?
Do they have any API? Web Services? What would be a way to collect that data using an .NET application?
Any feedback, blog, or documentation is greatly appreciated.
I need to write an Outlook 2003-2010 plugin using C# that adds two buttons to the Message Ribbon Bar (#1 on the picture) and a several buttons toolbar or a Form Region under the "Subject" line (#2 on the picture).
I have a web api application that has an ImageController. This controller works perfectly on my development environment (localhost) and i use Fiddler to test and see results. I purchased a hosting plan on GoDaddy and deployed my project. When using a Post method to some action, the data received in my JObject is null(locally data is received correctly as a json string)
this is my action signature:
publicvoid Post([FromBody]JObject jsonData)
Content-Type: application/json; charset=utf-8
Request Body is a json string that is validated and looks good.
I feel like having lost my OO knowledge. Actually, the problem looks simple: I want to create a class which operates on an object which
- inherits from System.Windows.Forms.Form
- implements the interface IDescribedActionsProvider
at the same time.
I could create a new Form type public abstract class SpecialForm : Form, IDescribedActionsProvider
and require a parameter of that SpecialForm type.
But it does not work here: most of our Forms inherit from OurCompanyForm which need not implement IDescribedActionsProvider, and some of our forms do not inherit therefrom, but when they implement the interface, they should be an acceptable parameter.
It is composition what is required here, not inheritance.
Then I thought of Generics. I could define my class like
publicclass FormController<T> : IDisposable where T : Form, IDescribedActionsProvider
internal FormController(OtherType otherObject, T controlledForm)
_OtherObject = otherObject;
_ControlledForm = controlledForm;
It would work the way I intended, but it feels totally wrong:
That's not what Generics (see MSDN[^]) were meant for.
And I get problems when I want to create that FormController object in a Factory (because of the OtherType which is created there) which is not generic, i.e. a function like public FormController<T> CreateFormcontroller(T controlledForm)
is not possible because T not defined here... And using "SpecialForm" instead of T does not work because of composition vs. inheritance.
What do you suggest? "Duck Typing" - but that's not a good OO practise either?