thanks a lot, this link solved my problem :)
der flori
Posts
-
Problem with SQL-Server Date Query -
Problem with SQL-Server Date Queryyes, they are stored with time! But when I change the string in this way I get an syntax error:
string str_Verlaufdate = "'" + p.Verlauf_date.Month + "/" + p.Verlauf_date.Day + "/" + p.Verlauf_date.Year + " 00:00:00'";
I don´t know, how the format of the string has to look like.
-
Problem with SQL-Server Date Queryhi, i have a little problem with the following Query:
string str_Verlaufdate = "'" + p.Verlauf_date.Month + "/" + p.Verlauf_date.Day + "/" + p.Verlauf_date.Year + "'";
DataRow[] dr2 = this.dataNet.Tables["Verlauf"].Select("BehID = '"+v[0].ToString()+"' and Date = "+str_Verlaufdate);
I don´t get any result, but there exist a lot of records that match to this date in the database!
-
EvaluateException at Select-Funktionhey, thanks a lot :))) that works fine and solves the problem perfectly!
-
EvaluateException at Select-FunktionI already tried to create a DateTime Object from
datum
and the Cast worked perfectly, but there occurs the same Exception when I edit the Code as follows:
DataRow[] VerlaufDatum = data1.Verlauf.Select("BehandlungsID=" + BehID + " AND Datum= '" + Convert.ToDateTime(datum) + "'");
I think it has something to do with the '=' Operator, but I don´t know what´s wrong with it :(
-
EvaluateException at Select-FunktionHi, I´d like to select DataRows with an Id and a Date, but I always get the following Error-Message: Cannot perform '=' operation on System.DateTime and System.String. Here my Code:
string BehID = data1.Behandlungen.Rows.Count.ToString();
string datum = microsim1["picdate"].ToString();
DataRow[] VerlaufDatum = data1.Verlauf.Select("BehandlungsID=" + BehID + " AND Datum= '" + datum + "'");It worked perfectly witch Visual Studio 2003, but with Visual Studio 2008 I always get this Exception :( thanks for your help.