|
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]
|
|
|
|
|
i am sory, my problem explaination was not enough at all.
first, i bound a DataTable to my DataGrid.
my problem is:
i have a TreeView in the same form of the dataGrid.
1. According to a specified condition I colored some of the datagrid cells (i color only the left section from the cell (assume red)).
2. For each TreeNode in this TreeView i make the value of some datagrid cells to be "true", in addition, i color the right section from this cell (assume green).
In the event treeView1_AfterSelect, i empty the DataTable to receive a new data for the new TreeNode. When i do this the color of the right section (green color) is alse deleted.
a) I want to keep this (green) color to be seen along all TreeNodes selection to ensure unique data selection (or no data is selected towice) for different treeNodes.
b) in addition, i want to return the cells that have a "false" value and a red color
thanks alot
|
|
|
|
|
hi,
What heath says is correct. And here i can give one more solution that is datagrid tablestyle. You can check my datagrid related article. There i mentioned rich usage of DataGridTableStyle class.;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I am creating a control assembly to house custom controls. I found the attribute that I can use to specify a custom bitmap but cannot find out how to specify the Tab to which my controls will be installed. I know I can manually move the controls around but I want to distribute this assembly to my team and have the components installed into a single custom Tab. Any ideas?
|
|
|
|
|
There's several ways of doing this, but none so easy as just using an attribute. You can use the VSIP (Visual Studio Integration Program) SDK - which you can find at http://msdn.microsoft.com/vstudio/extend/[^] - to install your controls into a toolbox group into Visual Studio while installing your control library. That's how most vendors do it.
You can also, if you can get a designer running in Visual Studio, use services to temporarily install toolbox items. Read about the IToolboxService in the .NET Framework SDK. There's a lot of links and examples to more information.
There are a lot of other design-time classes that may be helpful, such as the ToolboxItemAttribute and the related ToolboxItem classes, as well as the ToolboxItemFilterAttribute that shows or hides a toolbox item depending on what's currently being designed (or edited).
A good place to start reading about design-time extensibility is Enhancing Design-Time Support[^] in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi,
I'm just getting to grips with xml serialization, and I want to load this XML...
<?xml version="1.0" encoding="utf-8" ?>
<Files>
<AudioFile url="file.xyz" date="08/07/06">
<comments>Hello</comments>
</AudioFile>
<AudioFile ... >
...
</AudioFile>
</Files> I have an AudioFile class ready for deserialization of an AudioFile node, and I want to load all the AudioFile nodes into an ArrayList. What's the easiest way to do this?
I need this to make a data source for an Asp.net Repeater control... is there an altogether better way to do this for a very small number of entries?
Any help is much appreaciated...
Joel Holdsworth
|
|
|
|
|
You can't load that with XML Serialization. Collection objects - even with the XmlRootAttribute , will always have ArrayOfSomething , depending on a number of factors. Now, if you change <Files> to <AudioFiles> , you may have a chance. If you derive an object-model where AutoFile extends File , you might also have a chance.
Basically, read about the attribute classes in System.Xml.Serialization for more information about how to control the serialization and deserialization of classes using XML.
In many cases, however, trying to derive an object model from XML is far more difficult than creating the object-model first then creating the XML format, if you can.
Also, any IList or IListSource is data-bindable, so any list class - like ArrayList - can be bound. Typically, though, it's better to derive your own IList implementation rather than use ArrayList because you can attribute it how you need.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|