|
You may try this:
updatecom.CommandText = "update test2 set name='" + textBox1.Text + "', job= '" + textBox2.Text +"', title='" + textBox3.Text + "' where id='" + textBox4.Text + "'";
Fixed "," and "'"
Saludos!!
____Juan
|
|
|
|
|
Hi,
This might seem pretty basic but can anybody explain why and/or when a method should have the static or virtual? i.e.
public static void Method1()
{}
Thanks,
Prateek
|
|
|
|
|
|
I guess i should have checked msdn first before posting the question.
Thanks
|
|
|
|
|
|
I have a standard Calendar Control:
<asp:calendar id="calNewFirstDateAvailable" runat="server" tooltip="Select First Available Date" xmlns:asp="#unknown">
</asp:calendar>
And I am attempting to set a specific Date as the highlighted date programatically, but it is not highlighting the day in the control.
calUpdateFirstDateAvailable.SelectedDayStyle.BackColor = System.Drawing.Color.Black;
calUpdateFirstDateAvailable.SelectedDayStyle.ForeColor = System.Drawing.Color.White;
calUpdateFirstDateAvailable.SelectionMode = CalendarSelectionMode.Day;
calUpdateFirstDateAvailable.SelectedDate = atsi.StartDate;
calUpdateFirstDateAvailable.VisibleDate = atsi.StartDate;
atis.StartDate is a DateTime type with the value of '{11/12/2008 11:09:03 AM}'
What am I doing wrong?
Any Help would be greatly appreciated.
VS2008 .net 3.5
Thanks,
Robert
|
|
|
|
|
This may be completely wrong, but I recall the order you set the properties may have an affect on what and when is displayed.
BTW: ASP.NET questions belong in the ASP.NET forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Hello,
I can't seem to find any info regarding this because I don't know what to look for. I really have tried looking on the net, looking on here, searching both articles and message boards, and nothing is quite what I'm needing.
What I'm trying to do is find a component that shows the contents of my drive, similar to looking at the Desktop in the Explorer.
I would also like to have checkboxes next to the folder names so that a user can select multiple folders. Checkboxes are preferred, but if Ctrl+Select is the only option, then ok.
Something like this is out there... I know I've seen it somewhere, but just can't find out what it's called, or any code that uses it as an example.
Any suggestions?
Thanks,
Michael Fritzius
|
|
|
|
|
There's nothing that's standard, it would have to be a user control of some sort.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
That's fine--I'm not set on using anything standard anyway. But I wouldn't even know how to make my own control for this application. Has anyone made something like this?
|
|
|
|
|
|
Excellent. Looks like this would work. Thanks!
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi, i want to convert arrys of one type to arrays of another type
Here is the code that i have
public object ConvertTo(Type myType, object value) {
object[] ret = Array.ConvertAll(value as object[], delegate(object o) { return Convert.ChangeType(o, t.GetElementType()); });
return ret;
}
Everithing its just fine, but the problem using Array.ConvertAll is that I have an object[] reference, an not an t.GetElementType()[] reference
So, when i use the variable returned by that function, i have an InvalidCastException because object[] cannot be converted to myType[]
How can i make a cast to the type i really want?
The next code works perfectly, but i want it to work with a generic type
public object ConvertToStringArray(object value) {
string[] ret = (string[])Array.ConvertAll(value as object[], delegate(object o) { return o.ToString(); });
return ret;
}
Maybe the question is how to create an array of a type represented by an instance of System.Type
Example:
Type t = typeof(System.String);
Saludos!!
____Juan
|
|
|
|
|
Maybe you need to write a generic method that takes a type and creates an array of that type ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
hmmm..... sounds good.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You are almost right
Array.ConvertAll will convert the array, and all the objects included in the array will have the right type (t.GetElementType() in my example)
The problem is, that Array.ConvertAll returns a reference who is an object[], and, when i use this object as a parameter to a method, that gives me an InvalidCastException because it cannot convert from object[] to myType[], i mean, if you want to convert to string[] you may just write
string[] test = (string[]) Array.ConvertAll....
But here the type is given dynamicaly
I fixed it using a not very good strategy, but it works, here is the code:
public object ConvertTo(Type t, object value) {
if (t == null) {
return value;
}
if (t.IsEnum) {
return Enum.Parse(t, value.ToString());
}
if (t.IsArray) {
object[] _valArr;
if (value.GetType().IsArray)
_valArr = value as object[];
else
_valArr = new object[] { value };
Array ret = Array.CreateInstance(t.GetElementType(), _valArr.Length);
Array.ConvertAll(_valArr, delegate(object o) { return Convert.ChangeType(o, t.GetElementType()); }).CopyTo(ret, 0);
return ret;
}
return Convert.ChangeType(value, t);
}
Saludos!!
____Juan
|
|
|
|
|
Hi,
Is there any control available in Visual Studio 2008, which i can use to see pdf files in my Win Form Application, somewhat like RTF controls?
Thanks
Karmendra
|
|
|
|
|
|
Is there nothing available form open source or freeware,
I just need to view the pdf file on disk, needs nothing more other than viewing the pdf document, printing, zoom navigate etc are not required.
|
|
|
|
|
Acrobat Reader itself is free to use. In the search results there was an interesting looking article on top: http://www.codeproject.com/KB/cpp/ReaderWrapper.aspx[^]. Perhaps it would help you forward.
Also I believe that there are several other good hits on the results so have a look at them. Adding one keyword more (freeware) to the search gives you about 50,000 hits...
Google is your friend.
|
|
|
|
|
Hi all,
I have added a Northwind dataset to my project by selecting data | add new datasource. Now i can see the the Northwind.sdf and NorthwindDataSet.xsd files on the solution explorer. Question is how can I success to read the rows on the dataset/tables? What is the ConnectionString or do I need it in this case?
I though something like below but the tables.count is always null
DataSet myDataSet = new DataSet("NorthwindDataSet");
foreach (DataRow row in myDataSet.Tables["Customers"].Rows)
{
}
|
|
|
|
|
mhrtg wrote: What is the ConnectionString or do I need it in this case
You can see the connection string in the properties panel when you select your database. However, when with default settings, the database is copied into bin/debug folder when executing your program so the path is different at runtime.
mhrtg wrote: can I success to read the rows on the dataset/tables?
Even though you have added a database into your solution, it behaves like a normal database. So you have steps like:
- get a connection
- fill a dataset with data from db
- close the connection
- use the data in the dataset
|
|
|
|
|
Ok! I got the connection string but opening the connection seems to be a problem. Here is the example
string strConnectionString = "Data Source=C:\\Visual Studio 2008\\Projects\\SampleProgram\\bin\\Debug\\Northwind.sdf"
oconn = new SqlConnection(strConnectionString);
oconn.Open(); <----- error
Northwind.sdf was found from the debug folder
The error message in Finnish:
Palvelinyhteyttä muodostettaessa tapahtui virhe. Kun muodostat yhteyttä SQL Server 2005:een, tämä virhe saattaa johtua siitä, ettei SQL Server oletusarvoisesti salli etäyhteyksiä. (provider: SQL-verkon rajapinnat, error: 26 - Virhe etsittäessä määritettyä palvelinta tai ilmentymää)
|
|
|
|