|
Hello,
I have a big problem , i can't find a way to to pass a string variable to a dll calling a matlab program,
Really it's a very important to me
Thanks
|
|
|
|
|
Just type matlab into the seach box at the top of this screen and you will find and artilce called "1,2,3 MATLAB" or something similiar to that....
/\ |_ E X E GG
|
|
|
|
|
I am using aysynchronous socket communication between client and server. In BeginAccept function in server we have parameters : CallBack, object2.
In client BeginConnect it send we have parameters : Endpoint, callback, object1
Can I get object1 on server beginAccept when client connect as I have information about the client in object1.
So when I use object2 it should have information that I had in object1.
But this is not happening!!!
Can some one tell me how I can get information about client object on BeiginConnect()?
If so can you tell how to do this?
Client : m_sock.BeginConnect( epServer, onconnect, object1 );
Server : listener.BeginAccept( new AsyncCallback( app.OnConnectRequest ), object2 );
Thanks a lot
C. Anil
|
|
|
|
|
Hi
When i open the excel file , it displays the date in correct format for example : 20-Apr-05
When i read tthat cells date value its takes the same value as 38462.91672
How can i retrive the same date format in dotnet datetime format.
Open the excel application
Type any date
Right click ->Format cells --> choose Number Tab window -> select Category Number ->press ok
This format i get the values
How can i retrive the same values as Datetime format
Regards
sanjeev
|
|
|
|
|
Hello,
Try to use DateTime.FromOADate static method. It takes a double as parameter and converts it the DateTime object. 38462.91672 is OLE Automation date.
Quoting MSDN:
An OLE Automation date is implemented as a floating-point number whose value is the number of days from midnight, 30 December 1899. For example, midnight, 31 December 1899 is represented by 1.0; 6 A.M., 1 January 1900 is represented by 2.25; midnight, 29 December 1899 represented by -1.0; and 6 A.M., 29 December 1899 represented by -1.25.
Only DateTime objects with a tick value that is greater than or equal to positive or negative 31241376000000000 can be represented as an OLE Automation Date. An uninitialized DateTime, that is, an instance with a tick value of 0, is converted to the equivalent uninitialized OLE Automation Date, that is, a date with a value of 0.0 which represents midnight, 30 December 1899.
HTH. Cheers
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
I am trying to access XML web service in my Smart Device application from a remote computer .It is throwing exception (401) Unauthorized.can any body help me.
thx
Learner always
|
|
|
|
|
hai friends i have got a problem while adding the combobox to a windowsForms dataGrid..
my problem is if i select a data from the combobox the data is added to the data base...
but it is not gettting displayed on the datagrid...
my code goes like this
//creating the table style
DataGridTableStyle tablestyle=new DataGridTableStyle();
tablestyle.MappingName ="DataTablename";
//adding the combobox
DataGridComboBoxColumn crelation=new DataGridComboBoxColumn(); crelation.MappingName="Column name";
crelation.HeaderText="Relation";
crelation.Width=100;
crelation.ColumnComboBox.DataSource=Dataset.Tables[5].DefaultView;
crelation.ColumnComboBox.DisplayMember ="ColumnName";
crelation.ColumnComboBox.ValueMember="Id";
tablestyle.GridColumnStyles.Add(crelation)
DataGrid1.TableStyles.Clear();
DataGrid1.TableStyles.Add(tablestyle);
thanks
|
|
|
|
|
i am IT student from malaysia but i don't have any knoeledge about C#.....i want to learn the C# programming language but i don't know what software do i need to install to run the C#.....Thank you
|
|
|
|
|
You need to install the .NET framework. Also, if you don't have an IDE, you can try Sharp Develop[^], although I would personally recommend buying the student version of Visual Studio, for a myriad of reasons.
However, if you download the .NET framework SDK[^], you will have everything you need to write C# programs in notepad, if you really want to
I should mention that the .NET framework is all people need to RUN your software, but the SDK also gives you the compiler and tools needed to create the files from source code. You get all that installed for you if you buy VS.NET, plus you get the full MSDN library ( more info than you could buy in books for the same price ), and a productivity boosting IDE that will make you far more likely to succeed in learning/using C#.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am new to DirectX programming and I am looking for a little help setting up methods to load multiple .x files and textures. If anyone has any examples that I could look at it would be helpful. If you have any questions or if I need to clarify what I what I am looking for please write.
Thanks for any help
any help out there?
|
|
|
|
|
I am kind of stuck on stupid, and need some help. The following code works only once and then I get and error because of multi '@Param' use. I coded it this way because of the need to do some conversions as you can see. Can someone tell me how to code this in the correct way? I am new at this kind of code.
Norm
try
{
sqlInsertCommand1.CommandText = "INSERT INTO services([service-code], [service-description] ,[large-animal-cost], [medium-animal-cost], [small-animal-cost])" +
" values(@Param1,@Param2,@Param3, @Param4,@Param5) SELECT @@IDENTITY";
SqlParameter param = sqlInsertCommand1.Parameters.Add("@Param1",SqlDbType.Int);
param.Value = txtServiceCode.Text;
param = sqlInsertCommand1.Parameters.Add("@Param2",SqlDbType.VarChar);
param.Value = txtServiceDesc.Text;
param = sqlInsertCommand1.Parameters.Add("@Param3",SqlDbType.Money);
param.Value = Convert.ToDecimal(cbLargeAnimalCost.Text);
param = sqlInsertCommand1.Parameters.Add("@Param4",SqlDbType.Money);
param.Value = Convert.ToDecimal(cbMediumAnimalCost.Text);
param = sqlInsertCommand1.Parameters.Add("@Param5",SqlDbType.Money);
param.Value = Convert.ToDecimal(cbSmallAnimalCost.Text);
sqlInsertCommand1.Connection = sqlConnection1;
if (sqlConnection1.State != ConnectionState.Open)
sqlConnection1.Open();
sqlInsertCommand1.ExecuteNonQuery();
nbohana
|
|
|
|
|
The best way to do this is to write a stored procedure. If you don't have a real database, then you can try giving your parameters reasonable names.
However, the problem here is that sqlInsertCommand1 appears to be a member variable, which means that
NormBohana wrote:
SqlParameter param = sqlInsertCommand1.Parameters.Add("@Param1",SqlDbType.Int);
the second time around is trying to add a parameter that is already there. Instead, you should not make the command a member, or put the parameters in when you create it ( I'd put it in a property to do this, if it was me, with lazy initialisation ), and then find the parameters to set them instead of adding them. But this is really messy, and error prone, because you introduce state needlessly. You should only have one piece of generic code that calls this SQL, that's what creating a stored procedure would help you enforce.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi
Can anybody help me in reading data from Excel
i want to place my Excel sheet in my application folder,and read it through application. no matter where the application is placed wether in c:/ or d:/.
Basically my requirement is should not Hard-Code the Path of Excel Sheet
fdvddsfcdsfcdvdfvfdsfsadfdsfdsfsdf
|
|
|
|
|
|
This is driving me crazy. I keep getting the big ugly useless block of text errors and I can't figure out why. Take for example this snippet from my aspx page...
<asp:ImageButton id="ibRoles" runat="server" ImageUrl='<%# GetImageLink("pawn_glass_blue.gif"); %>' CommandName="Roles" AlternateText="Roles" ToolTip="Edit roles"></asp:ImageButton>
You see that I know the name of the image that I want, so I am trying to pass it to a method in my .cs file that will determine the full path to the image, plop the image on filename on the end and deliver it back to the caller. Here is the GetImageLink method...
public string GetImageLink(object imageName)
{
string path = Request.Path.Substring(0,
Request.Path.LastIndexOf("/") + 1 );
return path + "Resources/BlueImages/"
+ (string)imageName;
}
I have tried making the parameter a string and an object. It doesn't matter. The page parser pukes on it every time.
It seems to me that this is fundamental. Why can't I find any examples for this that aren't assuming I am getting my input from a bound database?
Phillip H. Blanton
www.ComponentScience.net
Email: Phillip at that domain that you see one line above the line you are reading now.
|
|
|
|
|
Phillip H. Blanton wrote:
I have tried making the parameter a string and an object
Make it string.
Phillip H. Blanton wrote:
The page parser pukes on it every time.
What errors are you getting ? Have you stepped into the code to see what is passed in and what goes back ?
BTW, you can make your method protected.
Also, use Path.Combine to build a path string, rather than trying to keep track of the /'s yourself.
I do notice in my own codebehind that the semicolon after the method name is not needed - have you tried removing it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have tried it without the semicolon as well.
this is the error that I get at runtime. No breakpoints are ever hit.
Unhandled error loading module.
DotNetNuke.Services.Exceptions.ModuleLoadException: External component has thrown an exception. ---> System.Web.HttpException: External component has thrown an exception. ---> System.Web.HttpCompileException: External component has thrown an exception. at System.Web.Compilation.BaseCompiler.ThrowIfCompilerErrors(CompilerResults results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String sourceFile, String sourceString) at System.Web.Compilation.BaseCompiler.GetCompiledType() at System.Web.UI.UserControlParser.CompileIntoType() at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation() --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound) at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() at System.Web.UI.TemplateParser.GetParserCacheItem() at System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String virtualPath, String inputFile, HttpContext context) at System.Web.UI.TemplateControlParser.GetCompiledType(String virtualPath, String inputFile, HttpContext context) at System.Web.UI.UserControlParser.GetCompiledUserControlType(String virtualPath, String inputFile, HttpContext context) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---
If I remove the line that calls the codebehind method then the page displays but there is no image of course.
Phillip H. Blanton
www.ComponentScience.net
Email: Phillip at that domain that you see one line above the line you are reading now.
|
|
|
|
|
Could dotnetnuke be the problem ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
He! It quite often is.
I poked around a bit and finally got this to work...
<asp:ImageButton id="ibRoles" runat="server" ImageUrl='<%# GetImageLink("pawn_glass_blue.gif") %>' CommandName="Roles" AlternateText="Roles" ToolTip="Edit roles"></asp:ImageButton>
<asp:ImageButton id="ibEdit" runat="server" ImageUrl='<%# GetImageLink("draw.gif") %>' CommandName="Edit" AlternateText="Edit" ToolTip="Edit resource"></asp:ImageButton>
<asp:ImageButton id="ibDelete" runat="server" ImageUrl='<%# GetImageLink("delete.gif") %>' CommandName="Delete" AlternateText="Delete" ToolTip="Remove resource"></asp:ImageButton>
with this...
protected string GetImageLink(string imageName)
{
return Request.Path.Substring(0,Request.Path.LastIndexOf("/")+1 )
+ "DesktopModules/My_Module/App_LocalResources/" + imageName;
}
I don't know what the original problem was due to the useless error message.
And.. for what it's worth, I am not just combining paths. I am yanking the filename off of the Request.Path and then appending the test of the path to it to get the location of the images.
Phillip H. Blanton
www.ComponentScience.net
Email: Phillip at that domain that you see one line above the line you are reading now.
|
|
|
|
|
I would like to enhance a standrd ToolBar by providing an ownerdrawn Panel for the n-most sub-menu item of which will contain icon images that represent various tools (like the MS Word "AutoShapes" dropdown tool selection Panel). This is easy enough to do.
The problem is on MeasureItem and DrawItem, I only have the object coordinates of the item being drawn relative to "itself" not to the screen or client region (From 0,0 to however big the ownerdrawn button will be). I do not have the "actual" screen coordinates in which the rectangular region is being drawn. If I had the screen coordinates, when the end-user performs a mouse click on the ownerdrawn panel (populated with icon images)...I will be able to determine exactly where inside the ownerdrawn region the user click.
Where on the screen or client area is the menuitem being drawn?
Any help would be greatly appreciated.
-------------------------------------------------------
|0,0 (screen) |
| I need -> ?,? |
| this at ---------------- |
| DrawItem. |0,0 (menuitem)| |
| | | |
| | | |
| | 500,500| |
| ---------------- |
| |
| |
| |
| 1000,1000 |
-------------------------------------------------------
Don
|
|
|
|
|
|
Actually, I've read through most of these ownerdrawn articles and have (I believe) exhausted all possiblities using this approach.
The problem I am having is this; not only to I have to draw a X by Y panel of images for the ownerdrawn ImageItem, I have to be able to determine which image (screen region) has been clicked on. The coordinates that I have availble to be during DrawItem or MeasureItem are the coordinates associated with region that will occupy the MenuItem. That region begins at 0,0 .... not 0,0 the upper left-hand corner of the screen or client area. 0,0 of the MenuItem.
I think the only way I am going to be able to do this is to some how determine where on the screen (or client area) the ownerdrawn MenuItem is being drawn so that I can correlate the Form MouseDown location with the location of the chosen image in the ownerdrawn MenuItem.
The functionality that I am trying to replicate is that of the MS Word "Drawing" tool bar. Specifically, the "AutoShapes" drop down menu, with sub-menus that have image selection panels. I would like to create something like this.
So, my real question is this;
How do I know the screen position that an ownerdrawn MenuItem is being drawn on?
Thanks,
Don
|
|
|
|
|
don ashworth wrote:
so that I can correlate the Form MouseDown location with the location of the chosen image in the ownerdrawn MenuItem.
I may be missing something here. Why don't you just add an event handler to the Click event for the MenuItem?
OK, let's say you want to implement drag functionality--click and hold and drag the mouse to the drawing surface. Yes, I can see this is a problem. But keep in mind that a menu can be activated from the keyboard, which is why you aren't given mouse events for menu items. Of course, a menu that is supposed to select a drawing tool sort of implies you have some sort of a mouse device to the drawing with!
Ugh. I guess if you want drag functionality, the solution is to not use an owner draw MenuItem. MenuItem has a "Select" event which is raised when the menu item is selected (not clicked)--for example, used to display help text about the menu item. From there, it seems you would have to place an owner drawn panel, or something. But you still have the same problem--how do you know the coordinates of the menu item for the Select event?
Nasty problem. Sorry I can't help more!
Marc
My website
Latest Articles:
Undo/Redo Buffer
Memento Design Pattern
|
|
|
|
|
No sweat. Thanks for entertaining the question. Eventhough I do not have a solution yet, I fell better that at least one other person has come to the same conclusion. Looks like I need to write a home grown n-level menu.
Thanks again,
Don
|
|
|
|
|
Hello,
I'm trying to retrieve a page from a webserver, but I keep getting a "The server committed a protocol violation. Section=ResponseStatusLine" error in my program. This is using a the very simple code below:
<br />
string hostURL = "http://patft.uspto.gov";<br />
string URLSuffix = "/netacgi/nph-Parsernetacgi/" + "nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1" + "&u=/netahtml/srchnum.htm&r=1&f=G&l=50&" + "s1=6223224.WKU.&OS=PN/6223224&RS=PN/6223224";<br />
<br />
string lcUrl = hostURL + URLSuffix;<br />
HttpWebRequest webrequest =<br />
(HttpWebRequest)WebRequest.Create(lcUrl);<br />
webrequest.Timeout = 10000;
webrequest.UserAgent = "Code Sample Web Client";<br />
webrequest.ContentType = "text/html";<br />
webrequest.AllowAutoRedirect = true;<br />
<br />
HttpWebResponse loWebResponse = HttpWebResponse)webrequest.GetResponse();<br />
Encoding enc = Encoding.GetEncoding(1252);
StreamReader loResponseStream =<br />
new StreamReader(loWebResponse.GetResponseStream(), enc);<br />
string lcHtml = loResponseStream.ReadToEnd();<br />
<br />
loWebResponse.Close();<br />
loResponseStream.Close();<br />
The problem appears, via HTTP trace, that the server is returning a code "200 Script results follow". I also downloaded the HTTP sniffer from The Code Project (HTTPeep) which did not function (threw off same error). Linux wget chokes as well.
Is there any way to force the program to treat that server code as a "200 OK" code, or to otherwise ignore it?
Thanks in advance,
Colin
|
|
|
|
|