|
|
Using HttpUtility.Encode results in System.Uri throwing an exception, since it can't process the encoded info.
Uri uri = new Uri(HttpUtility.UrlEncode(url));
|
|
|
|
|
I have a co-worker that created an form in Access 2000. In order to use it every where I need to install MS Access 2000. How can I show this form in MFC and allow the end user to use it without having to install MS Access 2000 on all PC's?
Thanks
This is also posted on the VC++ forum.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
You should probably remove the reference to MFC in the C# forum.
Whatever language you use, you can write a program that reproduces the form, and does the same work to the data in the database. I doubt you can just host the existing form in an outside program.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can't use the form he created in Access 2000 without installing Access 2000.
You'll have to recode the form using whatever language you like and duplicate the functionality that you need.
Tom Wright wrote:
This is also posted on the VC++ forum.
:SMACK!: Cross-posting is considered very rude! Especially when you post the question in a forum that has nothing to do with the language your using...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a problem using InvokeMember.
When calling the method I have:
t.InvokeMember(widget.InitMethod, BindingFlags.DeclaredOnly |BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, newWidget, widget.Parameters);
Info on vars:
newWidget is a object of the class WSlider. WSlider has a method called InitSlider(int,int,int).
widget.Parameters is a object array which holds 3 int values. widget.InitMethod holds "InitSlider".
Now, this just throws me a MissingMethodException. It works fine with one parameter, but as soon as I add more it crashes. Anyone got a clue on this?
|
|
|
|
|
case-block was followed by a ;
too many hours up.
|
|
|
|
|
the ; was not the problem. still open for comments!
|
|
|
|
|
What's widget.InitMethod? Are you sure the method name's right? Also, make sure you have the correct assembly loaded.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Found the problem. I had a mismatch in my data type passing methods when parsing the XML files that holds states for the new objects.
|
|
|
|
|
I am trying to crawl using the following code snippet.
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Win32)";
...
By default, the req.AllowAutoRedirect is true and MaximumAutomaticRedirections is 50.
When I try to crawl the following URL.
http://citeseer.ist.psu.edu/rd/55811103,653,1,0.25,Download/http://citeseer.ist.psu.edu/cache/papers/cs/7145/http:zSzzSzwww.stanford.eduzSzclasszSzcs343zSzpszSzpathprof.pdf/ball96efficient.pdf
I get NameResolutionFailure exception. However, I am able to open this URL from the browser and it gets redirected to:
http://citeseer.ist.psu.edu/cache/papers/cs/7145/http:zSzzSzwww.stanford.eduzSzclasszSzcs343zSzpszSzpathprof.pdf/ball96efficient.pdf
How do I force my C# code to go to the redirected url?
|
|
|
|
|
I am trying to check a database to see if a record exists(ComputerName) in a database. If it does NOT exist, then I want to run an Insert. If it DOES exists, then I want it to update the database. It seems like I would use an IF statement, but I am unsure of how to do it.
Eric
|
|
|
|
|
SqlDataReader reader = new myCommand.ExecuteReader();
while(reader.Read())
{
if(reader[Key]== youValue)
{
}
else (
)
}
|
|
|
|
|
I'm using a popup dialog with a listbox to allow the user to set/change a parameter. In addition to selecting a value and clicking OK I'd like to allow the user to be able to doubleclick on a value and have it close with the doubleclicked value used. The problem is that I can't tell the difference between a doubleclick on an item in the box, and one in empty space below the last valid entry. IN the latter case I want to do nothing. My current handler instead returns with whatever the last valid selection was.
<br />
private void OnDoubleClickPriority(object sender, System.EventArgs e)<br />
{<br />
m_sSelectedText = m_lbPriority.GetItemText( m_lbPriority.SelectedItem );<br />
Close();<br />
}<br />
|
|
|
|
|
In the MousDown event of the listbox call the IndexFromPoint function of the ListBox with the given coordinates and assign it to some member variable. In the DoubleClick handler you can then check if an appropiate index was hit (if I remember right IndexFromPoint return -1 if no item was hit).
|
|
|
|
|
Thanks. That worked perfectly.
|
|
|
|
|
Can some one please helpe me!
I want to bulid a com addin for PowerPoint that overrides the save command to display a custom SaveAs dialog. When the user has selected the save location i want to call the "SaveAs" method of the Presentation object. The problem is that it casts an exception (unknown member). Is this a bug in PowerPoint or is there an workaround?
Thanks
Be paragmatic
|
|
|
|
|
I am working on a server application and I want it to start with the windows startup. Can somebody tell what I should do?
Thanx anyways.
|
|
|
|
|
There are 3 ways to achive this.
1. add a shotcut in the startup folder in the programs menu (only works if the user is logged on)
2. Add the application to the run folder in the registry. (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run)
3. create it as a Windows service. there is a template for creating a windows service project in VS.net
Hope that was helpfull..
Be pragmatic
|
|
|
|
|
Hi, I want to bold all the dates stored in my database for this purpose I am using the following code of lines
string [] str;
char []sperator = {'/' ,' ' };
foreach ( DataTable table in dataset.Tables )
{
foreach ( DataRow row in table.Rows )
{
s1=(row["D"]).ToString();
str=s1.Split(sperator);
this.monthCalendar1.MonthlyBoldedDates = new System.DateTime[]
{
new System.DateTime
(Convert.ToInt32(str[2].ToString()),Convert.ToInt32(str[0].ToString()),Convert.ToInt32(str[1].ToString()))
};
}
}
but this code only bold the last date read from the database. Please help me in this regard I will be very thankful to u.
|
|
|
|
|
Try it this way (havent compiled it so it probably has some minor errors):
string [] str;
char []sperator = {'/' ,' ' };
ArrayList datesList = new ArrayList();
foreach ( DataTable table in dataset.Tables )
{
foreach ( DataRow row in table.Rows )
{
s1=(row["D"]).ToString();
str=s1.Split(sperator);
datesList.Add(new System.DateTime(Convert.ToInt32(str[2].ToString()),
Convert.ToInt32(str[0].ToString()), Convert.ToInt32(str[1].ToString())));
}
}
DateTime[] datesArray = new DateTime[datesList.Count];
datesList.CopyTo(datesArray);
this.monthCalendar1.MonthlyBoldedDates = datesArray;
|
|
|
|
|
How do I get the database schema once I have set up an OdbcConnection? Primarily I need a list of tables and columns in the database. My App needs to be able to connect to any ODBC datasource and work out what tables and columns it contains.
TIA
|
|
|
|
|
I have started to use the ODBC calls and P/Invoke as the Odbc stuff is .Net is sorely lacking.
Still can't get it work though.
IntPtr henv;<br />
short ret;<br />
<br />
ret = SQLAllocHandle(SQL_HANDLE_ENV, (IntPtr)SQL_NULL_HANDLE, out henv);<br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
ret = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,(IntPtr)SQL_OV_ODBC3, 0);<br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
IntPtr hdbc;<br />
ret = SQLAllocHandle(SQL_HANDLE_DBC, henv, out hdbc); <br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
ret = SQLConnect(hdbc, dsn, SQL_NTS, null, SQL_NTS, null, SQL_NTS);<br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
IntPtr hstmt;<br />
ret = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, out hstmt);<br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
ret = SQLTables(hstmt, null, SQL_NTS, null, SQL_NTS, null, SQL_NTS, null, SQL_NTS);<br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
StringBuilder tableName = new StringBuilder(256);<br />
int tableNameLen;<br />
ret = SQLBindCol(hstmt, 2, 1, tableName, 256, out tableNameLen); <br />
if(ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)<br />
{<br />
while(SQLFetch(hstmt) == SQL_SUCCESS)<br />
{<br />
Console.WriteLine(tableName + ":" + tableNameLen.ToString());<br />
}<br />
}<br />
}<br />
<br />
ret = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);<br />
}<br />
<br />
ret = SQLDisconnect(hdbc);<br />
}<br />
ret = SQLFreeHandle(SQL_HANDLE_DBC, hdbc);<br />
}<br />
}<br />
ret = SQLFreeHandle(SQL_HANDLE_ENV, henv);<br />
}
The SQLFetch will be called as many times as there are tables in the dsn but the dsn is empty and tableNameLen is -1.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
pardon my ignorance, but I am very new to Windows form development and am not sure how to get his done. And I can't seem to find the correct solution through any of the forums or msdn.
So here is my question: I have created a form with a datagrid on it. I want to open up a new form which when you double click on the record in the datagrid from the parent will open up a data entry screen with all of the information in it.
Thanks in advance.
mike
|
|
|
|
|
The method:
You must create the form you wnto to be a parent example: called it Form2.
Then you place the controls on it, wich you need, and declared it Public or create a get/set property for them
Last step, where you need to see the new window, place a code like this:
<br />
Form2 f2=new Form2();<br />
<br />
f2.textBox1.Text="This works!";<br />
.....<br />
f2.Show();
<br />
I think that's you need to do.
|
|
|
|