|
Anonymous wrote:
I don't know how to contact you
That makes two of us. Neither do I.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
aren't you afraid the entire board would chime in?
I still crack at Mr. Beans "Me too, too!"
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist Fold With Us! || Agile Programming | doxygen
|
|
|
|
|
Pah! I say to thee! I know no such fear!
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Hi group,
I have a dataset which contain two tables of same structure (Same data type, same number of column). Say tab1,tab2. I want to merge tab1 to tab2.Then i will clear the content of tab1.
Eg; int tab1cnt=dataset.tables["tab1"].rows.count;
int tab2cnt=dataset.tables["tab2"].rows.count;
After merging
the row count of tab2 need to be the sum of tab1cnt and tab2cnt.
Which one is the beast way to achive this result without iterating through any of the row in any of tables.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
You can use the Merge method of the DataSet class, but you'll need to create a couple of temporary variables along the way.
DataSet temp = new DataSet("temp");
DataTable tab1Copy = tab1.Copy();
temp.Tables.Add(tab1Copy);
temp.Tables["tab1"].TableName = "tab2";
temp.Merge(ds.Tables["tab2"]);
temp.Tables.Remove("tab2");
ds.Tables.Remove("tab2");
ds.Tables.Add(tab1Copy);
ds.Tables["tab1"].Rows.Clear();
tab2 = ds.Tables["tab2"];
temp = null;
tab1Copy = null; I'm sure this isn't the only way of doing this, but it works.
Charlie
if(!curlies){ return; }
|
|
|
|
|
hi,
So you got my question properly and you got i what i don't want to do for merging (unwanted iterations for filling the record). Thanks .
.
Let me use your concept first and if i get anything beeter than this from this concept then surly i will post in the same thread. Sometime it may help others.
finally thanks;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi,
I want to change the LicenseURL for already encrypted movie file,
i tried it with the help of download.download(Windows Media Rights Manager 9 Series SDK), but at the time of calling this function i get exception as
The object was not created with Server.CreateObject.
Please help me reagrding this.
Vaibhav
|
|
|
|
|
G'Day ppl...
currently am working on my project by using C#, but am not familiar with its running environment. As its part of my project, i have to creating database from MSDE, and using C# to reading those data. I am not so sure whether the commands are, and plz someone help me. ( I know how to use the command for MS ACCESS)
Pls help !!!
ppck
|
|
|
|
|
Hello:
this is an example for take data from SQL, we use a formBase that contains a property ConnSQL, and all the forms inherit from it, we have 3 elements
1 )This is the connection String = (on the login form)
this.ConnSQL="data source="+this.Srv+";initial catalog="+this.DbN+";password="+this.loginControl1.Password+";persist security info=True;user id="+this.loginControl1.Username+";workstation id="+this.Ter+";packet size=4096";
2 ) this is the call for data = (on the customers form)
public void EjecutarBusqueda(string Comando)
{
System.Data.DataSet Ds = new System.Data.DataSet();
System.Data.DataSet Contactos = new System.Data.DataSet();
string cadenaBuscar = ("Select * From Customers Where " + Comando);
Ds=General.TraerDatos(this.SQLConn,cadenaBuscar);
....
}
the string "Comando" is the condition for the select, is provided for the user
3 ) this is the method that return the data = (on General Class, for use it everywhere on the proyect)
public static System.Data.DataSet TraerDatos( string SQLConn,string Commando)
{
DataSet mDataSet=new DataSet();
SqlConnection ObjConn=new SqlConnection(SQLConn);
SqlDataAdapter ObjDato = new SqlDataAdapter(Commando,SQLConn);
try
{
ObjConn.Open();
ObjDato.Fill(mDataSet);
ObjConn.Close();
return mDataSet;
}
catch
{
MessageBox.Show ("Error al ejecutar la consulta " + Commando);
return null ;
}
}
I hope that it help you!!
bye
Vanesa Addicted To DJ Tiësto's Trance
|
|
|
|
|
Hi,
As I mentioned in the subject the question is simple... I have a web form in my site and I have to periodically send data to this form by using a windows form application written in C#
Thank you,
Cem Louis
|
|
|
|
|
hi,
I got your submition. But where is your queary or what is your doubt ?
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Do you need the query? I didn't want to post the url to a high known forum...
|
|
|
|
|
hi,
You Wrote :
Do you need the query? I didn't want to post the url to a high known forum...
What you mean by this ?
What i asked you is What's is your doubt ? What you really want to know ? Which sort of help ? Nothing else.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi,
Thank you for your interest, anyway here is the link: http://www.stratejiparki.com/name.php[^] When you wrote and submit something it displays what you had written... I made a form and put a textbox, button, label on it. Then I made the button's click function like below:
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
WebClient client = new WebClient();<br />
NameValueCollection form = new NameValueCollection(); <br />
form.Add("email", textBox_email.Text.ToString()); <br />
Byte[] responseData = client.UploadValues("http://www.stratejiparki.com/name.php"); <br />
<br />
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create("http://www.stratejiparki.com/name.php");<br />
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse( );<br />
StreamReader streamReader = new StreamReader(webResponse.GetResponseStream( ), Encoding.ASCII);<br />
string outputString;<br />
outputString = streamReader.ReadToEnd( );<br />
streamReader.Close( );<br />
label1.Text = outputString;<br />
}<br />
The thing that I want is to write a string to the textbox on windows form than press the button. The textbox's text must go the form on www.stratejiparki.com/name.php then the windows form takes the data on showname.php and write to the label on windows form...
Thank you,
Cem Louis
|
|
|
|
|
Look at the following code:
<br />
Catalog cat = new CatalogClass();<br />
cat.Create(connStrAccess);<br />
<br />
Table dtNaslov = new TableClass();<br />
dtNaslov.Name = "Naslov";<br />
dtNaslov.Columns.Append("ID_Naslov",DataTypeEnum.adInteger,4);<br />
dtNaslov.Keys.Append("ID_Naslov",KeyTypeEnum.adKeyPrimary,"ID_Naslov","Naslov","ID_Naslov");<br />
dtNaslov.Columns.Append("Ulica",DataTypeEnum.adVarWChar,50);<br />
dtNaslov.Columns.Append("PostnaSt",DataTypeEnum.adSmallInt,4);<br />
dtNaslov.Columns.Append("Kraj",DataTypeEnum.adVarWChar,50);<br />
cat.Tables.Append((object)dtNaslov);<br />
<br />
Table dtPotnik = new TableClass();<br />
dtPotnik.Name = "Potnik";<br />
dtPotnik.Columns.Append("ID_Potnik",DataTypeEnum.adInteger,4);<br />
dtPotnik.Keys.Append("ID_Potnik",KeyTypeEnum.adKeyPrimary,"ID_Potnik","Potnik","ID_Potnik");<br />
dtPotnik.Columns.Append("ID_Naslov",DataTypeEnum.adInteger,4);<br />
dtPotnik.Keys.Append("ID_Naslov",KeyTypeEnum.adKeyForeign,"ID_Naslov","Naslov","ID_Naslov");<br />
dtPotnik.Columns.Append("Ime",DataTypeEnum.adVarWChar,50);<br />
dtPotnik.Columns.Append("Priimek",DataTypeEnum.adVarWChar,50);<br />
cat.Tables.Append((object)dtPotnik);<br />
<br />
Table dtPartner = new TableClass();<br />
dtPartner.Name = "Partner";<br />
dtPartner.Columns.Append("ID_Partner",DataTypeEnum.adInteger,4);<br />
dtPartner.Keys.Append("ID_Partner",KeyTypeEnum.adKeyPrimary,"ID_Partner","Partner","ID_Partner");<br />
dtPartner.Columns.Append("ID_Naslov",DataTypeEnum.adInteger,4); <br />
dtPartner.Keys.Append("ID_Naslov",KeyTypeEnum.adKeyForeign,"ID_Naslov","Naslov","ID_Naslov");<br />
dtPartner.Columns.Append("Naziv",DataTypeEnum.adVarWChar,100);<br />
cat.Tables.Append((object)dtPartner);<br />
A problem is, when debug mode is trying to do cat.Tables.Append((object)dtPartner). It
throws an exception: "ID_Naslov object already exist". Why is that? I only want to
create a relationship between Naslov & Potnik tables and Naslov & Partner tables.
How can I create a Foreign key in table Partner? It generates Foreign key in table
Potnik perfectly, but in Partner table it throws an exception.
Can someone please help?
|
|
|
|
|
|
Hi all,
I would like to know if it is possible to use .NET generated XML Web Services from Java?
One more question, is that possible to import Java's .jar files to C# directly or should I compile them in J# and import the outcoming .dll to C#?
Regards,
-
When in doubt, push a pawn!
-
|
|
|
|
|
Hi,
I designed a textbox coltrol (size 200 x 25) in WinForm.
The textbox's properties:
Multiline = true
Scrollbars = none
Maxlength = 60
When I input string to the textbox, I can input more than 2 lines until the string
size become 60.
But I really want to input only 2 lines even though the textbox's lenght is less
than 60.
How can I do that.
Plz, Somebody help me.
Thanks.
|
|
|
|
|
You can get the total lines the Textbox has, by P/Invoking SendMessage with EM_GETLINECOUNT .
If total lines exceeds MaxLines(2 in your case), you do not allow any thing to be written in the TextBox
Below code will help you to achieve the same.
public const int EM_GETLINECOUNT = 0xBA;
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern Int32 SendMessage (Int32 hWnd, Int32 wMsg , Int32 wParam , Int32 lParam );
public static int GetTotalLines(TextBox tb)
{
int totalLines = 0;
totalLines = SendMessage(tb.Handle.ToInt32(), EM_GETLINECOUNT, 0, 0) + 1;
return totalLines;
}
|
|
|
|
|
Sorry for inturruption Jay_sh_s,
Nevertheless how do you know about these .dlls, like user32.dll? Are these .dlls coming from your C background? How can I learn what these .dlls are doing?
Regards,
-
When in doubt, push a pawn!
-
|
|
|
|
|
I refer MSDN for all the details.
|
|
|
|
|
Thanks a million
I will try.
|
|
|
|
|
the data in mysql uses utf8 encoding, i had try to display the data throught web pages with php,, works fine with selecting encoding to utf in IE. but when i extract from mysql with C# it doesn't look right,
anyone know why?
|
|
|
|
|
I have a datagrid, all of its columns are bool columns. According to a specified condition I colored some of the datagrid cells. I want to return the colored cells that have a value = "false" when I click the button "OK"
|
|
|
|
|
The DataGrid is only a view of the data. The best place to query this information is from the data that's bound to the DataGrid . This greatly depends on the underlying data store. If you're using a DataSet or DataTable , enumerate the DataRow s and with each row enumerate the fields. What you do with this data is specific to your implementation and requirements.
So, whatever you bound to the DataSource (and, optionally, DataMember ) properties of the DataGrid , you need to get back (cast the DataSource property to whatever type you assigned to it originally) and enumerate.
If you used some other IList or IListSource implementation, you need to do roughly the same thing.
No one can really help you further without knowing what you bound to the DataGrid . Even using the BindingContext property requires knowledge of what type of data store you bound so one can know which BindingManagerBase derivative to refer to.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|