|
I owned this registry key, and I can do what the app should do by hand using regedit.
This is one line of my code, works well under Vista, Win 7, it just has problem with Win 8 UAC enabled.
RegistryKey rk = Registry.ClassesRoot.OpenSubKey(subkey, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl);
|
|
|
|
|
I am currently a student in TYBSC(IT) so I had a query that in C# windows form If for example a clientname combobox is there and on selecting the client Name in the combobox the 2 text boxes clientAddress and ClientNumber should be retrieved from the database and get filled in the textboxes.
Sir please help me in my project my mailing me a demo program so that I can Find A Solution to It.
Please Sir and as sson as possible as jan end is ma submission date
trishal
|
|
|
|
|
Try something and if you run into issues, post what you have done here.
Someone might be able to help you.
|
|
|
|
|
Sir can you give me your email id son that i will send my code to you its having some errors can you correct and give me???
|
|
|
|
|
Show your code (just the part with the errors) and the error messages here, and people will try to help you.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
public partial class Form1 : Form
{
string Id = "";
string Address = "";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.testTableAdapter.Fill(this.database1DataSet1.Test);
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string SelectedId = Convert.ToString(comboBox1.SelectedValue);
if (Convert.ToString(comboBox1.SelectedValue) != "")
database1DataSet1.DataSource = Database1DataSet1TableAdapters.GetData(int.Parse(SelectedId));
var Id = from r in testTableAdapter.GetData()
where r["Id"].ToString() == SelectedId
select r["Name"];
var Address = from r in testTableAdapter.GetData()
where r["ProductId"].ToString() == SelectedId
select r["Address"];
foreach (var unit in Id)
Id = id.ToString();
foreach (var measure in Name)
ProductMeasure = measure.ToString();
textBox1.Text = Id;
}
|
|
|
|
|
And the question is?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
u have to bind the two textbox to the same datasoure and the data will apper automatically
all waht u have to do is to put this code to the Load event
private void Form1_Load(object sender, EventArgs e)
{
this.testTableAdapter.Fill(this.database1DataSet1.Test);
comboBox1.DataSource = this.database1DataSet1.Test;
comboBox1.DisplayMember = "Name";
textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.database1DataSet1.Test, "Id", true));
textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.database1DataSet1.Test, "Address", true));
}
|
|
|
|
|
Read this[^] and update your question to the guidelines.
No one will "give" you code, you will need to write it yourself. If you want ready-to-go code, try here[^].
|
|
|
|
|
Hello everyone! I would like to know how I can read metadata of exported types using the Managed Extensibility Framework. I am using Visual Studio 2008 with .Net Framework 3.5.
In .Net Framework 4.0, this can be achieved through type 'Lazy' but this is not available in .Net Framework 3.5.
Since 'ExportMetadata' was provided in the version of MEF provided for .Net Framework 3.5, I do believe there is a way of reading the metadata in the framework 3.5 but I don't know how this is done. Any guidance, please?
|
|
|
|
|
Well I found out that 'Lazy' is available in MEF Preview 9 for .Net Framework 3.5.
I was previously using MEF Preview 5 which did not contain 'Lazy'. Thanks.
|
|
|
|
|
Hello All,
For each solution I have created, I have been adding the installing NLog for each of the solution. It is adds the NLog.config file.
Since I have different solutions, it is always adding the file as Nlog.config.
can I change this name, and give it a name specific to the solution? change the Nlog.config to SolutionA_Nlog.config?
Thank you!
|
|
|
|
|
I havent used NLog before but if you application is executable you can add the NLog Config information to AppConfig.
check this link[^] more details on how to configure NLog Config
Jibesh V P
|
|
|
|
|
vanikanc wrote: can I change this name, and give it a name specific to the solution
I believe so but why would you do that?
Presumably by "solution" you mean deliverable executable. If so each should be installed into their own directory and have their own log file. And so the same name is probably better.
|
|
|
|
|
Awesome! I like the idea of creating each exe having its own directory.
And yes, by solution I did mean executables.
You see we currently have something set up, where everyone copies their executables at the root of the folder. No structure what so ever!!
|
|
|
|
|
vanikanc wrote: where everyone copies their executables at the root of the folder
Certainly not what I would suggest. Makes updating a single deliverable which has shared dependencies impossible.
|
|
|
|
|
Hi,
I have created a .net 4.0 windows form project.
It is on my laptop. In development.
I need to reference a dll from another server into this project.
How can I do that?
Thanks so much!
|
|
|
|
|
seriously!!. it's not a good idea to refer a file from a shared path. your application will fail if you try to deply/run in other PC.
btw what's you real problem? and what is the role of the referring dll??
Jibesh V P
|
|
|
|
|
as per jibesh - it doesnt sound like a good idea .. the most stable ways I can think of are
a) get a copy of the dll for your dev machine - transfer by usb/email/carrier pidgeon
b) map a permanent share to the machine where the dll is and reference the dll on the path
Unless you're back in the good old days of c++ rpc, there's no way to request dll type services over the net (and even then, rpc requires/required a mapping and comms layer to do so)
'g'
|
|
|
|
|
When you add a reference over the network, the IDE will make a local copy of this dll anyway.
So, nothing should be stopping you from copying the dll to your own machine / project folder and referencing it from this local location.
|
|
|
|
|
i use c# with asp.net ,i didn't understand how to add zoom bar to my google map.
in the aspx file the map configure like this:
<cc1:gmap id="GMap3" runat="server" width="850px" height="500px" language="he"
="">
and the key is configure in the cs file.i saw lots of exsample but evrything in aspx file ,and if i try to change there something i have error in the visual studio.
so i hust want to know how to add this zoom bar in the left
|
|
|
|
|
That GMap declaration looks like it belongs to a control in your solution. That is the area you need to look at, and the code is probably going to be in JavaScript.
|
|
|
|
|
Have a self-hosted WCF REST service w/ custom authentication (UsernamePasswordValidator). I need to return business specific errors from the validator. All methods I have tried to do this with have failed because all the errors get hidden by the HttpWebRequest object in a generic "Forbidden." error. My latest attempt was to write an error code back. Normally, I would do this by using the OperationContext.Current to get the response stream, but OperationContext.Current = null. How does one initialize this in a self-hosted service?
|
|
|
|
|
I have a form with a progressBar on it. I'm doing writes in another class (through my interface) and need to show my progress of doing the writes, but I'm getting an error message *. Hopefully someone has an idea how to get the error to go away and so I can update my progressBar from a different class.
I'm more of a C++ developer doing C#, so there might be something that an experienced C# person would know of that I'm missing.
It looks like this:
PC.cs [Design]
Form with progressBar displayed
PC.cs
private int writeIt(ref byte[] wDat, byte[] sDat)
{
result = cr.ProcessTWriting(ref wDat, ref pb_Progress.Value);
}
* In the code above, I'm getting "A property, indexer or dynamic member access may not be passed as an out or ref parameter" error message.
My interface looks like this:
iCR.cs (which is in another VS project due to future CR6, etc. which will use the interface)
int ProcessTWriting(ref byte[] wDat, ref int pb_value);
Then, I want to pass my references (to progressBar value) to where I'm writing my bytes (i to 1024), and update the reference to the progressBar as it iterates through, writing to it's destination.
This would be in my CR5.cs which implements iCR.cs (and is in another VS project still...think Factory pattern):
public int ProcessTWriting(ref byte[] WDat, ref int pb_value)
{
status = AttemptWrites(ref pb_value);
}
And the method it calls:
private int AttemptWrites(ref int pb_value)
{
for (int i = 0; i < ((wDat.Length) / 4); i++)
{
}
}
Does anyone have a suggestion how to get my progressBar to update as I iterate through each byte I'm writing in my other class? I've looked at a couple of similar situations and there do seem to be people passing an index of an array, but I'm having trouble figuring out how to apply them to my situation. If I assign pb_value to a temporary value, passing it as a reference, it won't update my progressBar.Value as I do my writes and update the temporary reference to the value. Here's the links I found on the topic:
http://stackoverflow.com/questions/4813289/a-property-indexer-or-dynamic-member-access-may-not-be-passed-as-an-out-or-ref[^]
http://stackoverflow.com/questions/12440013/a-property-indexer-or-dynamic-member-access-may-not-be-passed-as-an-out-or-ref[^]
http://stackoverflow.com/questions/4518956/a-property-or-indexer-may-not-be-passed-as-an-out-or-ref-parameter[^]
http://stackoverflow.com/questions/6492097/a-property-indexer-or-dynamic-member-access-may-not-be-passed-as-an-out-or-ref[^]
Hopefully it's not TMI, but I figure, the more info the better so people can see where I'm coming from.
|
|
|
|
|
Sorry in advance for my english. Possibly is not good enough yet...
Do you have the possibility to change your interface?
I'm thinking that a solution to your problem could be the use of events on your CR5 class. (Observer pattern)
You could create an event on CR5 class that can be subscribed by the class that contains the progress bar. Then, you can fire your event on the AttempWrite function with a parameter that indicates de current progress value to set into the progress bar.
Is it a possibility? Or are you constrained to this interface contract?
|
|
|
|