Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble in parameters
Message
From
12/10/2005 02:08:34
 
 
To
12/10/2005 01:54:22
Glenwell Andal
Pdc Software Philippines
Quezon, Philippines
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
01058178
Message ID:
01058211
Views:
14
Well, here's what I was talking about for your parameter:
cmdInsert.Parameters.Add("@" & sColumnName, ds.Tables(tableName).Columns(iCtr))
I hope that's the right syntax, I'm better at C#. <g>

As far as the CommandBuilder goes, here's some sample C# code using it:
SqlDataAdapter da = new SqlDataAdapter("select * from MyTable", this.TestConnection);
SqlCommandBuilder sb = new SqlCommandBuilder(da);
da.Fill(MyDataSet);

// whatever your code here is to change your data

da.Update(MyDataSet);
Does this help?

~~Bonnie
>For iCtr = 0 To ds.Tables(tableName).Columns.Count - 1
>	sColumnName = ds.Tables(tableName).Columns(iCtr).ColumnName
>	
>         Select Case ds.Tables(tableName).Columns(iCtr).DataType.Name
>	
>         Case "Int32"
>	   oleType = OleDbType.BigInt
>	   iColumnSize = 4 '****>>>> I want to value from the dataset<<<<<****
>         Case "String"
>	   oleType = OleDbType.VarChar
>	   iColumnSize = 50
>	End Select
>
>	param = cmdInsert.Parameters.Add("@" & sColumnName, oleType, iColumnSize, _
>              sColumnName)
>Next
>
>*/Notice that I only assume the value of "size" or iColumnsize = 4
>
> Can u give some sugestion of Update, delete, and insert data in Datagrid except using a CommandBuilder.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform