Click here to Skip to main content
15,878,543 members
Home / Discussions / Database
   

Database

 
Questionsql 2005 32bit & 64 bit? Pin
costavo3-Aug-07 10:03
costavo3-Aug-07 10:03 
AnswerRe: sql 2005 32bit & 64 bit? Pin
Mike Dimmick3-Aug-07 13:38
Mike Dimmick3-Aug-07 13:38 
Questionfile with dot sql extension Pin
ASPnoob3-Aug-07 5:45
ASPnoob3-Aug-07 5:45 
AnswerRe: file with dot sql extension Pin
Mike Dimmick3-Aug-07 6:49
Mike Dimmick3-Aug-07 6:49 
AnswerRe: file with dot sql extension Pin
originSH5-Aug-07 21:51
originSH5-Aug-07 21:51 
QuestionActual probs in procedure..., Pin
Member 38798813-Aug-07 4:04
Member 38798813-Aug-07 4:04 
AnswerRe: Actual probs in procedure..., Pin
Colin Angus Mackay3-Aug-07 4:19
Colin Angus Mackay3-Aug-07 4:19 
QuestionTrying to convert some VB code into C# Pin
c0rvus3-Aug-07 2:57
c0rvus3-Aug-07 2:57 
Hey there,
I've never liked databases and will probably never do so rather than trying to build my own database connection class I copied one written in VB.Net.
Dont know why but it does not work :-?
Here is the code:

[code]
Public Sub FindAndSelect(ByVal TheTableName As String, ByVal oFindValue As String, ByVal ColName As String, ByVal xColName As String, ByRef xValue As String)
Dim i As Integer
For i = 0 To MyDts.Tables(TheTableName).Rows.Count - 1
If MyDts.Tables(TheTableName).Rows(i).Item(ColName) = oFindValue Then
xValue = MyDts.Tables(TheTableName).Rows(i).Item(xColName)
Exit For
End If
Next
End Sub
[/code]

That looks this way after converting it (at least imho Wink | ;) )

[code]
public static void FindAndSelect(string tableName, string findValue, string colName, string xcolName, string xValue)
{
for(int i = 0; i < MyDts.Tables.Count; i++)
{
if(MyDts.Tables[tableName].Rows[i].Item[colName] = findValue)
{
DataRow row = new DataRow();
xValue = MyDts.Tables[tableName].Rows[i].Item[colName];
DataRowCollection col = new DataRowCollection();
break;
}
}
}
[/code]

But that causes a compiler error in the lines:
if(MyDts.Tables[tableName].Rows[i].Item[colName] = findValue)
&
xValue = MyDts.Tables[tableName].Rows[i].Item[colName];
saying that "System.Data.DataRow does not contain a definition for 'Item'".
I dont understand that since it works in VB.Net and according to the MSDN the DataRow class has a 'Item' member.
http://msdn2.microsoft.com/en-us/library/system.data.datarow_members(VS.71).aspx
Any ideas?
AnswerRe: Trying to convert some VB code into C# Pin
Pete O'Hanlon3-Aug-07 3:32
mvePete O'Hanlon3-Aug-07 3:32 
GeneralRe: Trying to convert some VB code into C# Pin
c0rvus3-Aug-07 13:43
c0rvus3-Aug-07 13:43 
GeneralRe: Trying to convert some VB code into C# Pin
Pete O'Hanlon5-Aug-07 9:13
mvePete O'Hanlon5-Aug-07 9:13 
AnswerRe: Trying to convert some VB code into C# Pin
Blue_Boy3-Aug-07 5:15
Blue_Boy3-Aug-07 5:15 
QuestionHow to communicate an AJAX and SQL directly Pin
Exelioindia3-Aug-07 2:35
Exelioindia3-Aug-07 2:35 
AnswerRe: How to communicate an AJAX and SQL directly Pin
Mike Dimmick3-Aug-07 2:53
Mike Dimmick3-Aug-07 2:53 
QuestionSyntax error converting datetime from character string..., Pin
Member 38798813-Aug-07 1:01
Member 38798813-Aug-07 1:01 
GeneralRe: Syntax error converting datetime from character string..., Pin
Sohail_Shaikh3-Aug-07 1:23
Sohail_Shaikh3-Aug-07 1:23 
GeneralRe: Syntax error converting datetime from character string..., Pin
Sohail_Shaikh3-Aug-07 1:23
Sohail_Shaikh3-Aug-07 1:23 
GeneralRe: Syntax error converting datetime from character string..., Pin
Member 38798813-Aug-07 1:40
Member 38798813-Aug-07 1:40 
GeneralRe: Syntax error converting datetime from character string..., Pin
Krish - KP3-Aug-07 1:44
Krish - KP3-Aug-07 1:44 
GeneralRe: Syntax error converting datetime from character string..., Pin
Krish - KP3-Aug-07 1:50
Krish - KP3-Aug-07 1:50 
GeneralRe: Syntax error converting datetime from character string..., Pin
Krish - KP3-Aug-07 2:02
Krish - KP3-Aug-07 2:02 
AnswerRe: Syntax error converting datetime from character string..., Pin
Pete O'Hanlon3-Aug-07 1:23
mvePete O'Hanlon3-Aug-07 1:23 
AnswerRe: Syntax error converting datetime from character string..., Pin
Krish - KP3-Aug-07 1:37
Krish - KP3-Aug-07 1:37 
GeneralRe: Syntax error converting datetime from character string..., Pin
Member 38798813-Aug-07 1:42
Member 38798813-Aug-07 1:42 
GeneralRe: Syntax error converting datetime from character string..., Pin
Member 38798813-Aug-07 1:44
Member 38798813-Aug-07 1:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.