|
Redesign your data, lesson 101 of normalised data is that you only store information 1 time table 4 should have BookID, AuthorID and PubID not the information.
BTW I hope that is not the name of your table.
If you want to learn about this try and get hold of microsoft Pub demo database, it deals with this exact industry.
Also please read the guidelines for posting.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
oops i am sorry........thanks for the reply
|
|
|
|
|
This is the wrong forum.
Remove this message from here and post it in the "General database" forum - this will help you in getting a better response.
My signature "sucks" today
|
|
|
|
|
Hi ever1,
I have listBox and via coding add sth to it. I would like after I add item it select.
I eana this approach for delete and undo an item from list box.
string[] Field = new string[9];
private string SaveDataBeforDel(string Fr_Name, string Sr_Name, string St_Id, double Lb_Mark, double Ass1, double Ass2, double Fnl, double TotalMark, string Grade)
{
Field[0] = Fr_Name;
Field[1] = Sr_Name;
Field[2] = St_Id;
Field[3] = Convert.ToString(Lb_Mark);
Field[4] = Convert.ToString(Ass1);
Field[5] = Convert.ToString(Ass2);
Field[6] = Convert.ToString(Fnl);
Field[7] = Convert.ToString(TotalMark);
Field[8] = Grade;
CleabTxtBox();
return string.Empty;
}
private void LstBox_SelectedIndexChanged_1(object sender, EventArgs e)
{
if (LstBox.SelectedIndex != -1)
{
ITECH3219Student s = (ITECH3219Student)LstBox.SelectedItem;
Assigningdata_Totextbox(s.Fr_name.ToString(), s.Sr_Name.ToString(), s.St_Id.ToString(), s.Lb_Mark, s.Ass1, s.Ass2, s.Fnl, s.TotalMarkCalculation(),s.Grade.ToString());
}
}
private void Btn_Del_Click(object sender, EventArgs e)
{
Btn_Del.Enabled = false;
Btn_undo.Enabled = true;
SaveDataBeforDel(Txt_name.Text, Txt_surname.Text, Txt_Id.Text,Convert.ToDouble(Txt_lbmark.Text), Convert.ToDouble(Txt_ass1.Text), Convert.ToDouble(Txt_ass2.Text), Convert.ToDouble(Txt_final.Text),Convert.ToDouble(Txt_total.Text), Txt_grade.Text);
LstBox.Items.RemoveAt(LstBox.SelectedIndex);
}
private void Btn_undo_Click(object sender, EventArgs e)
{
Btn_Del.Enabled = true;
Btn_undo.Enabled = false;
Student_Manipulation s = new Student_Manipulation();
LstBox.Items.Add(s.AddStudent_Tolist(Field[0], Field[1], Field[2]));
Txt_lbmark.Text = Field[3];
Txt_ass1.Text = Field[4];
Txt_ass2.Text = Field[5];
Txt_final.Text = Field[6];
Txt_total.Text = Field[7];
Txt_grade.Text = Field[8];
ITECH3219Student s1 = (ITECH3219Student)LstBox.SelectedItem;
Assigningdata_Totextbox(Field[0], Field[1], Field[2], Convert.ToDouble(Field[3]), Convert.ToDouble(Field[4]), Convert.ToDouble(Field[5]), Convert.ToDouble(Field[6]), Convert.ToDouble(Field[7]), Field[8]);
Do u have any idea how can I remove an item from list box. then undo that. aftyer undo that item select.
thx in advance
|
|
|
|
|
Hello,
I am using an .exe file at my client but it gives me the error "The application failed to initialize properly(0xc0000135).Click on OK to terminate the aplication".
Earlier I used to use the same .exe file which is made in the debug folder of project for other clients but I didnt face this issue.Can you please tell what must be the problem. The OS is Windows 2000 for client and I am using Windows XP.
Pritha
|
|
|
|
|
You probably need to install the .Net Framework on that computer. I think the highest version of the .Net Framework that will work on Windows 2000 is 2.0. By the way, Google is your friend.
|
|
|
|
|
The application developer used the .Net Framework, just install the framework and Re-run the application
Remember to Reboot
HAPPY WORKING
|
|
|
|
|
Hello,
Thanks for your replies.
But I have executed .exe on the PCs which do not have .Net Framework.
Are you sure that I need to load .Net Framework
Pritha
|
|
|
|
|
|
Thanks Amaan
Thanks for cooperating
|
|
|
|
|
0xc0000135 is the error code you get when your system does not include the expected version of .NET
.NET has many versions (from 1.0 up to 4.0), they can coexist (you can have many on one system), and your EXE by default needs a very specific version; the good approach is to have all of them available on your system.
Some Windows versions have some .NET versions preinstalled; XP and Vista often include 1.1, 2.0 and 3.0;
which are present can be seen by looking in C:\Windows\Microsoft.NET\Framework; the folder names (all but one) represent installed versions.
Some more details are available here[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thanks for your answer.
Does the same hold true for different versions of Excel.
Say if I have included a certain version of Excel.
Microsoft Excel 5.0 Object Library added as a reference in my project then it should work with the client only if it has that version of Object Library
Pritha
|
|
|
|
|
Excel is native code, not managed code, so it should always run fine, even without .NET present.
Excel automation through PIA (Primary Interop Assembly) may be different, and different versions of Office may require different PIA versions, I don't know any details.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
thanks for all your clarification
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi All,
I am writing a .net application that calls a COM interface. I can use / call this interace through out the program, just fine. But calling the same interface fails in the class destructor. I need to call it there because the COM interface has something like "disconnect" method that i need to call before exiting my app.
The error that i get (only when calling the interface from destructor):
"Unable to cast COM object of type 'MyCOMObject' to interface type 'MyCOMInterface'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9EA75075-57E3-4DCE-AACC-B87637142867}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))"
Anybody knows what I am missing or doing wrong?
Thanks in advance!
-Chris
|
|
|
|
|
You possibly need to implement the IDisposable pattern.
This will help you clean up your unmanaged resources and also call disconnect (possibly) before the Dispose() method is called.
My signature "sucks" today
|
|
|
|
|
Hello!!
I'm pretty new in .Net and now I'm using C# to do some test automation with System.Windows.Automation.
I Need to do a click on an specific area of the main window from the application that I want to test, this is defined as WindowPattern, Do you know how could I do this??
modified on Tuesday, June 1, 2010 3:01 PM
|
|
|
|
|
I'm trying to determine if its possible to get the row index of the data combination while avoiding the interation for-loop?
Here's an example below
DataTable may look like this (with variable named "datTab":
Name Number1 Number2 Number3 Number4
Ron 60 43 33 40
Sco 83 43 33 42
Alb 60 43 32 40
Hei 34 32 45 55
Ant 23 43 33 23
Now, the question is... is it possible to get the row index number if I would find the number combination with 4 numbers? Such as I would say to find 60, 43, 33, 42 and it would find the row index = 1. I understand it can do for one column, such as
int indexTab = datTab.Rows["Number1"].IndexOf("00");
but with multiple columns? I just thought of it as I use it in my code and the software is really sluggish with muliple columns using For-loop and if-statement inside the loop.
I hope someone can answer this. I'm hoping this will provide better performance.
Thanks!
|
|
|
|
|
select ROW_NUMBER() OVER(ORDER BY Name) AS RowNumber,Name,Number1,Number2,Number3,Number4
Then use a RowFilter on the default view to narrow down to the record you want and get the value of the RowNumber column.
|
|
|
|
|
can you provide an example? I'm not sure if I quite understand what you're saying.
|
|
|
|
|
Even if you don't write the iteration, it'll be there. I prefer to write my own stuff so I know what's going on, rather than wondering what's going on behind the scenes.
P.S. You could even write your own indexing using a hierarchy of Dictionaries.
|
|
|
|
|
You could have your fifth column be a combination of the numbers. So, the first row would have a "ComboColumn" value of "60,43,33,40". If you have a SQL query fill your DataTable, you could just have it return that "ComboColumn" in addition to the other columns. You could then use datTab.Rows["ComboColumn"].Indexof("60,43,33,40") to find the correct row. However, if that is still too slow, you may want to condider creating a dictionary object to hold the rows with the ComboColumn string as the key. Alternatively, if you are just looking for a single row and you are using SQL, it might be a good idea to just query for that specific row rather than gather data then find it. If you have an appropriate index setup on the table, that should be very fast (also depends on network speed and such).
|
|
|
|
|
hmm ComboColumn may be a good idea... I'll give that a shot and see what happens.
|
|
|
|
|
I am playing with a small program that sends emails through SMTP server. This is a C# Windows Forms application. The main part of the program looks like this:
using System;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
namespace test_email_smtp
{
public partial class send_mail_through_smtp : Form
{
public send_mail_through_smtp()
{
InitializeComponent();
}
private void send_mail_Click(object sender, EventArgs e)
{
SmtpClient client = new SmtpClient(smtp_server.Text);
MailMessage message = new MailMessage(send_from.Text, send_to.Text);
message.Body = mail_body.Text;
message.Subject = mail_subject.Text;
client.Send(message);
message.Dispose();
}
}
}
"send_from", "send_to", "mail_body", "mail_subject", and "smtp_server" are TextBox controls on the Form.
When I ran the program and click the "send" button, and then close the program (by closing the form), the mail is sent IMMEDIATELY.
However, if I click the "send" button and leave the program running (not closing the program), after a minute or so, I will get a message saying "Your mail message was unable to be sent because the connection to your mail server was interrupted. Please open your email client and re-send the message from the Sent Messages folder." This does not happen all the time. I'd say 9 out of 10 times this message was shown. The one time it was not shown, the mail was sent after a long time.
By the way, the message is from "Symantec Email Proxy". When this message was shown, a balloon message was also popped up by the system tray area saying "Scanning message 1 of 1", also from Symantec.
All these problems do not exist if I close the program after I click the "send" button. The mail will be sent immediately. I need the program to keep running after the mail is sent. I can't close the program every time a mail needs to be sent. Any ideas? Thanks!
|
|
|
|
|