|
The DGV is bound to a table. I have an inserted TextBoxColumn which is meant to display values from a related table.
I have my grid displaying nicely, with the empty text box column.
I have the values to insert into the grid.
But when do I do it? With which event handler?
I saw a suggestion to use DataBindingsComplete, but the column hasn't been inserted by the time that is called.
EDIT: Just had a thought. Don't auto-generate the columns. Manually create all the columns. Then add the rows, one-by-one, populating the columns as I go.
|
|
|
|
|
Nigel Mackay wrote: With which event handler? Depends on "how" you'd want to do so. One option would be the CellFormatting[^] event. Get's called whenever the value of a cell is needed. Check if the cell is in the last column, and if so, fetch the value - otherwise, display the default.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Yes, that would work. In fact it rings a bell from many years ago, along with CellValueNeeded and CellValuePushed.
Because I only have 2 bound and 1 unbound column and the grid is Read Only I created the grid manually. That way I can populate the grid while it is being built.
|
|
|
|
|
I am using c# to read and write my computer's parallel port. I am using a software named "winlpt" to manage it, and it works fine. Even I have attached an LED to my LPT1 port and it turns on if a use this software. But the issue I am facing is through programming. I am using inpout32.dll and also inpoutx64.dll but I can read my port using the address 888 but can not write to it with any value like 0 - 255 or even in binary form. My led do not lights up when I start my program. I have seen several samples on line all with similar code which I have and also downloaded any tried few of those demo projects but still not getting my led top anybody.
The c# code I am using:
PortInterop.cs file:
using System;
using System.Runtime.InteropServices;
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint = "Out32")]
public static extern void Output(int adress, int value);
[DllImport("inpout32.dll", EntryPoint = "Inp32")]
public static extern int Input(int adress);
}
Program.cs file (giving three different output values):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace leds
{
class Program
{
public static void Main(string[] args)
{
int address = 888;
int value;
value = PortAccess.Input(address);
Console.WriteLine("Input Value: " + value);
//FF or 255 D0-D7 on
PortAccess.Output(address, 255);
Console.WriteLine("\nOutput Value: 255");
Console.ReadLine();
//FF or 255 D0-D7 on
PortAccess.Output(address, 200);
Console.WriteLine("Output Value: 200");
Console.ReadLine();
//FF or 255 D0-D7 on
PortAccess.Output(address, 100);
Console.WriteLine("Output Value: 100");
Console.ReadLine();
//00 or 0 D0-D7 off
PortAccess.Output(address, 0);
Console.ReadLine();
}
}
}
And I am using windows 8.1, does it even works on win7++ OS?
Please help anybody.
Salman Malik
modified 29-Oct-14 8:41am.
|
|
|
|
|
obviously the hardware seems to work if 'winlpt' can light the LED - but you post no code, so we couldn't tell if anything looks wrong or not - I'd go back to your question/edit it, and post the smallest portion of code that you can, that illustrates you attempting to write to the port
also, if 'winlpt' is open source or has any useful notes, you might be able to glean how it works and apply that to you program
|
|
|
|
|
I have edited my post, can you help me now?
|
|
|
|
|
|
I have downloaded and tested this one but nothing seems to work
|
|
|
|
|
well, apart from checking the addresses thoroughly, Ive also read that you may needed to set 'bidirectional mode'.. it appears you write the value 32 to the control register, which is 890 - I'd google for
lpt bidirectional control port
for example and see what you can find
winlpt btw seems to be written in c++
|
|
|
|
|
After the load is connected to the variable string "connectionString", Question of the standard functions of C # can be taken out each piece as: [Server = localhost] and [Port = 5432] and ... [CommandTimeout = 10], to give them form into log form as SQL Server Management Studio 2005 from here Modifying, update, add delete, ... and after the break will be saved to the app.config file
|
|
|
|
|
|
This does not make any sense. Do you have a question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
What are you trying to accomplish? How does SSMS come in to play?
Is it simply that you are trying to connect SSMS to a database and you don't know which parts of a connection string to use?
|
|
|
|
|
Not sure what you are trying to achieve? Are you after connecting to your SQL Server database?
If so I would look at http://www.connectionstrings.com/sql-server/[^] That will show you how to configure / create a connection string that you can use within ado.net
this MSDN sqlconnection[^] will show you an example of how to connect to your database using the sqlconnection object.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Use the ConfigurationManager class to retrieve connection strings from configuration files, and the SqlConnectionStringBuilder class to handle connection string values.
|
|
|
|
|
i save connectstring warning error: The index being passed in is out of range
[CODE]
public void updateConfigFile(string con)
{
//updating config file
XmlDocument XmlDoc = new XmlDocument();
//Loading the Config file
XmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
foreach (XmlElement xElement in XmlDoc.DocumentElement)
{
if (xElement.Name == "connectionStrings")
{
//setting the connection string
xElement.FirstChild.Attributes[2].Value = con; // error here
}
}
//writing the connection string in config file
XmlDoc.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
}
[/CODE]
|
|
|
|
|
|
when running the program does not understand why the folder bin\Debug\ always appear 2 files: Myprogram.exe.config (file containing an unencrypted connection string) and Myprogram.vshost.exe.config (containing the string encrypted connection), it normally only files appear Myprogram.exe.config why appear another file ? how can I turndown one file ?
|
|
|
|
|
Myprogram.exe.config is what you distribute with your app.
Myprogram.vshost.exe.config is used when running within Visual Studio (and is NOT needed when you distribute your app).
HOWEVER, you should be building a "release" version (bin\Release) of your app when ready and using the EXE and config file for distribution from there.
Why one is encrypted and not the other is probably due to the way you are testing.
Build a "release" version of your app, run the EXE directly from the bin\Release folder and then check Myprogram.exe.config again.
If you need more info, start here:
http://stackoverflow.com/questions/774187/what-is-the-purpose-of-vshost-exe-file[^]
Most of this stuff is already out there if you just Google it.
|
|
|
|
|
Ok..so create a table in SQL Server with a [varchar](50) primary key and insert 500,000 dummy rows into the table. Now, in SSMS, select all rows from that table and you will see results immediately display in the Results window while the query is still running.
Opening an ADO.NET connection while awaiting an async reader will allow the thread to continue doing *different* work while the query runs, but I want to yield the results from my data layer to a UI layer as SQL Server prepares and marshals them.
Does anyone have any working samples (technology agnostic) or any links they can direct me towards?
"I need build Skynet. Plz send code"
|
|
|
|
|
Figured it out. never mind.
"I need build Skynet. Plz send code"
|
|
|
|
|
hi....
plz help me .....i urgently need code to implement FP Growth Algorithm in C#....mail it to me at
anil.nagar19@gmail.com
|
|
|
|
|
Voted as abuse.
You are asking volunteers that answer questions in their own spare time to do your work. There is no urgency here.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: There is no urgency here
Yes there is!
He has to hand it in to his tutor tomorrow!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Doesn't look like homework to me
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|