|
Guffa wrote: First sort the lists, then you can loop through them side by side
He can loop through the first ArrayList and use the .Contains(object item) method for the second array list and not interate through both ArrayLists.
just a thought
Nassos.NET
|
|
|
|
|
Hi
I have the following bit of code:
What the code is doing is inserting values into a table by selecting them from another table where a room code matches a room code in a session
however the insert is not working
any ideas?
cheers
SqlCommand cmd2 = new SqlCommand("INSERT INTO room_type_temp (Room_code, Room_description, area, instance_variant, Room_notes, height, spanotes, pladescription, perdescription, floor, walls, ceiling, doorsets, glazing, windows, chanotes, hatch, air, lighting, noise, safety, awt, ast, amvs, amve, amvsu, ap, af, ah, lsi, lsn, lli, lcr, lslg, nasl, nsp, nt, sahs, AF2, sdhw, atn, amn, apn, lsin, lsnn, llin, lslgg, lcrn, nn, sn, fn, npf, nms, nin, fe, fad, Room_Sheet SELECT Room_code, Room_description, area, instance_variant, Room_notes, height, spanotes, pladescription, perdescription, floor, walls, ceiling, doorsets, glazing, windows, chanotes, hatch, air, lighting, noise, safety, awt, ast, amvs, amve, amvsu, ap, af, ah, lsi, lsn, lli, lcr, lslg, nasl, nsp, nt, sahs, AF2, sdhw, atn, amn, apn, lsin, lsnn, llin, lslgg, lcrn, nn, sn, fn, npf, nms, nin, fe, fad, Room_Sheet FROM room_types where room_code = " + (Session["room_code"]), con);
|
|
|
|
|
sorry but this is almost unreadable - please reformat.
And: what is the exception - output?
|
|
|
|
|
Hi
ok let me make it simpler
I basically want to insert values into a table by selecting them from another table in the same query, however the post before does not work.
any suggestions?
cheers
|
|
|
|
|
Hi,
Please find below an sql query which I have used for one of my projects. Replace the columns and fields with yours and check whether it will suits with your requirement:
insert into stalericstemp1(RIC_Name, No_of_Days, Last_Update_Date, Next_Update_Date, PE_Fid1, HeadEnd_Fid1383, Location_Fid836, CTBTR_BKDG, Ric_Added_Date, Record_Entry_Date, StaleRic, Message, Updated_Date, File_no) select * from StaleRicsTemp where next_update_date > '11/25/2007' and next_update_date < '12/03/2007'
order by ric_name
The * in the select query of second table contains exactly the same field and datatype of first table. Please let me know if it helps you.
Meeram395
|
|
|
|
|
It looks like you are missing a parenthesis just before the SELECT.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Hi
How to make Multilanguage supportive textbox in C#.net
|
|
|
|
|
I have used a RichTextBox in the past, and simply required that the end user has the microsoft language pack installed. That way, the OS deals with the language exclusively (changing keyboard input and the like), which makes this kind of operation transparent to your application.
-Jeff
|
|
|
|
|
Hello everybody, I encounter a problem and need your help.
In a MDI application of C#, I want to show a PDF file in a child form. I have added a PDF browser to the child form and change it to pulic, just like below:
public AxAcroPDFLib.AxAcroPDF pdfBrowser;
When the MDI load, my code likes below:
Code:
private void MDIFrm_Load(object sender, EventArgs e)<br />
{<br />
ChildFrm myChildFrm = new ChildFrm();<br />
myChildFrm.pdfBrowser.LoadFile("C:\\dev\\linux-i18n-intro.pdf");<br />
myChildFrm.MdiParent = this;<br />
myChildFrm.Show();<br />
}
However,I can not see the PDF content in the Child form,but if I set the ChildFrm as the strartup object,it will show PDF correctly.
Could anyone give some suggestions?
Thanks very much!
Birch
|
|
|
|
|
I can only guess:
maybe the pdfBrowser loads an empty file on Form_Load?
Anyway: you should not put the pdfBrowser on a public property - better give the path to the constructor and set it in the form.
Anyway he problem seems to be with the pdfBrowser - maybe try using the webbrowser-control to show your files?
|
|
|
|
|
hi,
My aim is to print the datagridview text in to a textbox on clicking it .. i have done this before unfortunately i am not able to recollect it so if any one knows this please do inform me
REGARDS
SINDHU TIWARI
its me sid
|
|
|
|
|
just write the concerned code in cell click event
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
I have encountered similarly problem ,please give me some code for this question
my english is very bad!
|
|
|
|
|
Here is the code snippet:
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
}
Gopal.S
|
|
|
|
|
I have written many methods that using DataSet.
Now, I realise that I need the property 'CaseSensitive' of every DataSet instance to be 'true'. I don't want to change every source file to make it. Is there any simple way to make each DataSet instance created with 'CaseSensive = true'? e.g. envirment setting
I am using Visual Studio 2005 (.NET 2.0).
Thank you.
|
|
|
|
|
Hi all,
I recently found out about microthreads and I'm looking for more info on this topic (for implementation in C#) !
Any one knowing links to existing classes or articles ? Please let me know !
Thanks in advance !
Greetz,
Geert
|
|
|
|
|
Hi all,
I'm sending some data over TCP/IP and when I make use of a special character like ~ (tilde) it displays on my TCP/IP server as +AH4-
This is the code:
client.Client.Send(System.Text.Encoding.UTF7.GetBytes(richTextBoxSendData.Text));
Many Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
well seems your TCP/IP server don't understand UTF7 - try ASCII!
(System.Text.Encoding.ASCII.GetBytes(...)
|
|
|
|
|
Thanks for the response, I'll give it a shot
Regards
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hello All,
I have a situation here, where in, i have to pass a ref object to a method that has to be called within a thread. how to pass that ref object within the parameterized thread.
Public void methodname(ref string Strname)
{
..
..
..
}
parameterizedthreadstart prmThst = new ParameterizedthreadStart(mehthodname(ref StrName)
thread thnew = new thread(prmthSt);
this is throwing error..
Help is required..
Thanks and Regards
Bharath.S Ron
|
|
|
|
|
no you hate to put it that way:
<br />
ParameterizedThreadStart prmThst = new ParameterizedThreadStart(methodname);<br />
Thread thNew = new Thread(prmThst);<br />
<br />
thNew.Start(ref StrName);<br />
|
|
|
|
|
When attaching a datasource to a combobox, one can choose to specify its display and value member. For instance...
class PhoneContact
{
... // omitted
public string Name { get { return this.name; } set { this.name = value; }
public string Number { get { return this.number; } set { this.number = value; }
}
PhoneContact[] arr;
combobox1.DataSource = arr;
combobox1.DisplayMember = "Name";
combobox1.ValueMember = "Number";
I wanted the drop down list to show a combination of Name and Number concatenated together but the show just the number in the textbox field of the combobox. How do I do that?
drop down list will show like this,
Name1, Number1
Name2, Number2
..., ...
And after you select one of them, it only shows number in the textbox field and not the concatenated one.
Rationale:
You have a list of numbers in your phone book, I decided to allow the user to choose one of the numbers from the phonebook in a lookup manner via the combobox. Or if the number does not exist, one can key in any number not from the phonebook into the combobox textbox field. However, the combobox will only show the value from a single field specified by DisplayMember, if I had made "Number" as the display member, a drop-down list of numbers will be meaningless to the end user when he can't even tell who the number belongs to. And if I put the DisplayMember as "Name", somehow, the end user would not be able to verify if the number associated to the name is correct or wrong.
And ideas? Thanks
|
|
|
|
|
This is very easy in your example: just add a property - let's say
<br />
public string DisplayValue<br />
{ get { return Name + ", " + Number; } }<br />
to your PhoneContact class and use
<br />
combobox1.DisplayMember="DisplayValue";<br />
that's it.
|
|
|
|
|
Yes I've tried that myself,
the only catch is that after you have selected one of values in that concatenated form from the drop down list, the textbox field is populated with "Name, Number", where what I would liked was just the number itself in the textbox field.
Eventually, what I need is just the number value where for some reason can't just get from SelectedValue property.
In a case where no number exists in the drop down list, SelectedValue property will be null or empty if some other number was entered into the textbox field of the combobox.
string number = string.Empty;
If (combobox1.SelectedValue == null)
number = combobox1.Text;
else
number = combobox1.SelectedValue.ToString();
And that's exactly why after the selection from the drop down list, I only want a number and not the concatenated string of "Name, Number" to be in the number variable.
|
|
|
|
|
then use
<br />
number = combobox1.Text.Substring(0,combobox1.Text.IndexOf(','));<br />
in the case where SelectedValue == null !
|
|
|
|
|