|
It's impossible to answer your question without you supplying some context as to what you're trying to do.
Add a "category label"? To what? What kind of app are we talking about? Windows Forms? WPF? ASP.NET? MVC? What is this "product" you're talking about? I'm assuming you have a database behind this? How were the tables setup? ...? ...?
The quality of the answer you get is directly determined by the quality of the question you ask.
|
|
|
|
|
thank you.
i have visual studio 2010 with C# and relation.
(table)Client textbox:
ClientID ----->(relation table Order)ClientID
Name
Address
Housenumber
Zipcode
Phonenumber
Date
(table)Order datagridview:
OrderID
ClientID
Item
Qlt
Price
TotalePrice
Identity add -1 -2 -3 -4 -5 i want without "-" how dow i that?
thanks
|
|
|
|
|
Exact same problem. You're just assuming we can all just read your mind and see your screen.
Have a nice life.
|
|
|
|
|
|
With the complete lack of information you provided, nobody.
|
|
|
|
|
|
Hey, the quality of the question you ask directly dictates the quality of the answer you get.
If you ask an incomprehensible question, don't expect any answers.
|
|
|
|
|
|
And? You STILL don't know how to ask a question. That one doesn't provide anywhere near enough detail.
I have no idea what you're talking about when you said "identity without a hyphen".
|
|
|
|
|
hello everyone,
i made an application in c#, when i supposed to run the application it shows the following error,
Unhandled exception has occured in your applicaion.if you click continue the applicaton will ignore this error and attempt to continue.if you click quit the application will close immediately
Access to the path 'c:\tmp is denied.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.UnauthorizedAccessException: Access to the path 'c:\tmp' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at WaterMarking.ImageDoc.ImageDoc_Load(Object sender, EventArgs e) in C:\Users\Acer\Desktop\placement\projects\project3\WaterMarking\WaterMarking\ImageDoc.cs:line 936
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
WaterMarking
Assembly Version: 2.3.0.37769
Win32 Version: 2.3.0.37769
CodeBase: file:///C:/Users/Acer/Desktop/placement/projects/project3/WaterMarking/WaterMarking/bin/Debug/WaterMarking.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
DockingToolbar
Assembly Version: 1.0.1904.31915
Win32 Version: 1.0.1904.31915
CodeBase: file:///C:/Users/Acer/Desktop/placement/projects/project3/WaterMarking/WaterMarking/bin/Debug/DockingToolbar.DLL
----------------------------------------
WeifenLuo.WinFormsUI
Assembly Version: 1.2.1.0
Win32 Version: 1.2.1.0
CodeBase: file:///C:/Users/Acer/Desktop/placement/projects/project3/WaterMarking/WaterMarking/bin/Debug/WeifenLuo.WinFormsUI.DLL
----------------------------------------
ImageLib.Math
Assembly Version: 1.0.2893.5011
Win32 Version: 1.0.2893.5011
CodeBase: file:///C:/Users/Acer/Desktop/placement/projects/project3/WaterMarking/WaterMarking/bin/Debug/ImageLib.Math.DLL
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
ImageLib.Imaging
Assembly Version: 2.3.0.5413
Win32 Version: 2.3.0.5413
CodeBase: file:///C:/Users/Acer/Desktop/placement/projects/project3/WaterMarking/WaterMarking/bin/Debug/ImageLib.Imaging.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Please tell me what to do???

|
|
|
|
|
Look at the stack trace. It's telling you that the code blew up in your WaterMarking.ImageDoc.ImageDoc_Load method. You're doing something with a path, "C:\tmp", that isn't allowed by the user running the code.
|
|
|
|
|
To add to what Dave says, you should use Path.GetTempPath[^] to get the location of the temporary folder: "C:\tmp" would fail miserably on my pc, where the temp folder is on the "D:" drive!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Besides the above you might want to learn about logging libraries and how to catch exceptions and log them.
|
|
|
|
|
I need to ALTER merge sort algorithm to get length of an array and enter strings then sort them alphabetically ... Im stuck on the sort...my code atm.... The code doesnt sort as I know that it isnt comparing the strings it works in the original form with numbers already hard coded as in ALL the things i have seen and i understand the int sorting but as i said earlier i want it to accept inputted strings and compare them alphabetically and am finding no guidance on how this is to be achieved apart from the compareTo method...so when this runs i get the strings inputed on the txtoutput UNSorted but cant seem to alter the mergeSort to sort the entered strings alphabetically
private void btnExecute_Click(object sender, EventArgs e)
{
int length = Int32.Parse(Microsoft.VisualBasic.Interaction.InputBox("Enter a Number for how many Names to Sort :"));
string[] nameArray = new string[length];
foreach (string n in nameArray)
{
string name = Microsoft.VisualBasic.Interaction.InputBox("Enter " + length + " Names to add to Array:");
length = length - 1;
txtOutput.Text += name + "\r\n";
}
txtOutput.Text += nameArray.Length + "Names Added to List Unsorted ";
txtOutput.Text += "Sorted List : " + "\r\n";
mergeSort(nameArray, 0, nameArray.Length - 1);
foreach (string i in nameArray)
{
txtOutput.Text += i +"\t";
}
public void mergeSort(string[] nameArray, int lower, int upper)
{
int middle;
if (upper == lower)
return;
else
{
middle = (lower + upper) / 2;
mergeSort(nameArray, lower, middle);
mergeSort(nameArray, middle + 1, upper);
Merge(nameArray, lower, middle + 1, upper);
}
}
public void Merge(string[] nameArray, int lower, int middle, int upper)
{
string[] temp = new string[nameArray.Length];
int lowEnd = middle - 1;
int low = lower;
int n = upper - lower + 1;
while ((lower <= lowEnd) && (middle <= upper))
{
if ((nameArray[lower]).CompareTo(nameArray[middle])<= 0)
{
temp[low] = nameArray[lower];
low++;
lower++;
}
else
{
temp[low] = nameArray[middle];
low++;
middle++;
}
}
while (lower <= lowEnd)
{
temp[low] = nameArray[lower];
low++;
lower++;
}
while (middle <= upper)
{
temp[low] = nameArray[middle];
low++;
middle++;
}
for (int i = 0; i < n; i++)
{
nameArray[upper] = temp[upper];
upper--;
}
}
modified 12-Feb-15 6:50am.
|
|
|
|
|
int length = Int32.Parse(Microsoft.VisualBasic.Interaction.InputBox("Enter a Number for how many Names to Sort :"));
string[] nameArray = new string[length];
foreach (string n in nameArray)
{
You cannot use foreach at this point, since your array does not contain any strings. And even if it did, you never add them to the array. You should use the number as a loop counter and enter a string at each offset. Although you could probably improve this by using a collection class rather than an array.
|
|
|
|
|
Why? Sorting is already implemented in several places (for example in List<T> and Array, both are unstable introsorts)
|
|
|
|
|
The first thing you're going to have to do is actually split the strings out that you received in the InputBox. There's a massive hint there that you have to use string.Split to split the input[^] and return an array of characters.
|
|
|
|
|
Please, don't post code like that:
public void Merge(string[] nameArray, int lower, int middle, int upper)
{
string[] temp = new string[nameArray.Length];
int lowEnd = middle - 1;
int low = lower;
int n = upper - lower + 1;
while ((lower <= lowEnd) && (middle <= upper))
{
if ((nameArray[lower]).CompareTo(nameArray[middle])<= 0)
{
temp[low] = nameArray[lower];
low++;
lower++;
}
else
{
temp[low] = nameArray[middle];
low++;
middle++;
}
}
while (lower <= lowEnd)
{
temp[low] = nameArray[lower];
low++;
lower++;
}
while (middle <= upper)
{
temp[low] = nameArray[middle];
low++;
middle++;
}
for (int i = 0; i < n; i++)
{
nameArray[upper] = temp[upper];
upper--;
}
}
It makes it very hard to read!
Instead, use the "code" button above the text box to insert the <pre> tags which preserve formatting:
public void Merge(string[] nameArray, int lower, int middle, int upper)
{
string[] temp = new string[nameArray.Length];
int lowEnd = middle - 1;
int low = lower;
int n = upper - lower + 1;
while ((lower <= lowEnd) && (middle <= upper))
{
if ((nameArray[lower]).CompareTo(nameArray[middle])<= 0)
{
temp[low] = nameArray[lower];
low++;
lower++;
}
else
{
temp[low] = nameArray[middle];
low++;
middle++;
}
}
while (lower <= lowEnd)
{
temp[low] = nameArray[lower];
low++;
lower++;
}
while (middle <= upper)
{
temp[low] = nameArray[middle];
low++;
middle++;
}
for (int i = 0; i < n; i++)
{
nameArray[upper] = temp[upper];
upper--;
}
}
Second, a problem report like "Im stuck on the sort...my code atm.... Help its driving me loopy" tells us nothing at all about the problem you are having.
Tell us what it does that you didn't expect, or doesn't do that you did!
Tell us what data you use to test it, and what you expect to get as a result. Then show us what you do get!
The better the information you give us (and remember that we can't see your screen, access your HDD, or read your mind) the better we can help you to fix the problem.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
thankyou I apologize I am new to this but i did say I am having trouble ALTERING the code to accept strings rather than ints
as the original code has hard coded numbers the question needs to get 1 input box to give the array length which is working but the strings that are entered on the second input box i can not find where to compare the entered text to and sort them alphabetically on the go ....
|
|
|
|
|
That doesn't tell us anything about what kind of problem you are having doing it.
Since you wrote the code, we can safely assume that you fully understand it, but we don't know what part of your code you don't know to change! Or what is making it difficult for you.
Seriously, we can't see your screen - we only get what you give us to work with. So teh better the info you give us, the better we can answer...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I use to mark Dictionary of Cell type (of the GridView of DevExpress), for example, declare the type of row, I declared thus:
[code]
Dictionary<datarow, color=""> colors = new Dictionary<datarow, color="">();
[/code]
code above the type of row, declaration row is: DataRow, I want to replace the type DataRow is Cell type of the DevExpress GridView What is keyword in C# ?
|
|
|
|
|
What?? Your question made no sense at all.
How does a Dictionary relate to a GridView? What does a DataRow have to do with any of this?
|
|
|
|
|
my obstacles and express language, English is not my main language
In C # it allows type declarations corresponding row and column types as follows:
Dictionary<DataRow, Color> colors = new Dictionary<DataRow, Color>();
Dictionary<DataColumn, Color> colors = new Dictionary<DataColumn, Color>();
but I want to declare the type of cell that is the type of grid, I don't found place.
Dictionary<???, Color> colors = new Dictionary<???, Color>();
|
|
|
|
|
I have no idea what you're doing because the code doesn't make any sense to me. Why would you have an entire DataRow or Column as a key in a dictionary??
|
|
|
|
|
because I do not want to use the loop (for or while) to access grid
|
|
|
|
|