Table With TextBoxeshttp://forums.asp.net/t/1727688.aspx/1?Table+With+TextBoxesMon, 10 Oct 2011 17:16:17 -040017276884628044http://forums.asp.net/p/1727688/4628044.aspx/1?Table+With+TextBoxesTable With TextBoxes <p>hello i am new to this world of sql server's<br> and i whould like to know how to connect my Table to a TextBox&nbsp;</p> 2011-10-06T13:26:18-04:004628050http://forums.asp.net/p/1727688/4628050.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>I would suggest you start with some of these. some are short videos others are detialed walk throughs.</p> <p>great resource that got me started.</p> <p>&nbsp;<a href="http://www.asp.net/web-forms">http://www.asp.net/web-forms</a></p> <p>&nbsp;</p> <p>&nbsp;</p> 2011-10-06T13:30:21-04:004628060http://forums.asp.net/p/1727688/4628060.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p></p> <blockquote><span class="icon-blockquote"></span> <h4>march11</h4> <p></p> <p>I would suggest you start with some of these. some are short videos others are detialed walk throughs.</p> <p>great resource that got me started.</p> <p>&nbsp;<a href="http://www.asp.net/web-forms">http://www.asp.net/web-forms</a></p> <p>&nbsp;</p> <p>&nbsp;</p> <p></p> </blockquote> <p></p> <p>I dont see where it tells u about Sql</p> 2011-10-06T13:39:28-04:004628107http://forums.asp.net/p/1727688/4628107.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Try this one, its 43 minutes in all....</p> <p>&nbsp;</p> <p><a href="http://www.pluralsight-training.net/microsoft/players/PSODPlayer.aspx?author=dan-wahlin&amp;name=webforms-08&amp;mode=live&amp;clip=0&amp;course=aspdotnet-webforms4-intro">http://www.pluralsight-training.net/microsoft/players/PSODPlayer.aspx?author=dan-wahlin&amp;name=webforms-08&amp;mode=live&amp;clip=0&amp;course=aspdotnet-webforms4-intro</a></p> <p>&nbsp;</p> <p>&nbsp;</p> 2011-10-06T14:09:07-04:004628118http://forums.asp.net/p/1727688/4628118.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Hii,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Please refer belo Links.Surely it will help u.</p> <p></p> <p><a target="_blank" title="http://www.codeproject.com/KB/aspnet/InsertingWithGridView.aspx" href="http://www.codeproject.com/KB/aspnet/InsertingWithGridView.aspx">http://www.codeproject.com/KB/aspnet/InsertingWithGridView.aspx</a></p> <p><a target="_blank" title="http://www.codeproject.com/KB/vb/sqlcriptnet.aspx" href="http://www.codeproject.com/KB/vb/sqlcriptnet.aspx">http://www.codeproject.com/KB/vb/sqlcriptnet.aspx</a></p> <p><a target="_blank" title="http://www.codeproject.com/KB/database/sql_in_csharp.aspx" href="http://www.codeproject.com/KB/database/sql_in_csharp.aspx">http://www.codeproject.com/KB/database/sql_in_csharp.aspx</a></p> 2011-10-06T14:15:28-04:004628119http://forums.asp.net/p/1727688/4628119.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>This is the link I was first looking for sorry....</p> <p><a href="http://www.asp.net/general/videos">http://www.asp.net/general/videos</a></p> <p>&nbsp;</p> 2011-10-06T14:16:03-04:004628123http://forums.asp.net/p/1727688/4628123.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>its still doesnt answer my question :)</p> 2011-10-06T14:20:24-04:004628143http://forums.asp.net/p/1727688/4628143.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>There is no easier answer to your question. It depends on the datasource, and what you intend to do.</p> <p>Watching the videos will give you a good understanding about how to design your solution so that it is compatible with your objective.</p> <p>There are thousands of ways to connect them. You'll need to provide much more data before someone can offer more help.&nbsp; :)</p> <p>&nbsp;</p> <p>You can also do some research on SQL data Sources. Setting up a connection, Gridview, Formview, DetialsView these are controls that are&nbsp; used to display data. You don't generally output SQL data directly to a textbox.</p> <p>Good Luck.</p> <p>&nbsp;</p> 2011-10-06T14:39:20-04:004628173http://forums.asp.net/p/1727688/4628173.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p></p> <blockquote><span class="icon-blockquote"></span> <h4>march11</h4> <p></p> <p>There is no easier answer to your question. It depends on the datasource, and what you intend to do.</p> <p>Watching the videos will give you a good understanding about how to design your solution so that it is compatible with your objective.</p> <p>There are thousands of ways to connect them. You'll need to provide much more data before some can offer more help.&nbsp; :)</p> <p>&nbsp;</p> <p>You can also do some research on SQL data Sources. Setting up a connection, Gridview, Formview, DetialsView thes are controls that are&nbsp; used to display data. You don't generally output SQL data directly to a textbox.</p> <p>Good Luck.</p> <p>&nbsp;</p> <p></p> </blockquote> <p></p> <p>&nbsp;1. thank you<br> 2. i did set up my connection and i played a bit with GridView FormView and DetailsView</p> <p>3.im still looking for some answers on how to connect between them...<br> i used the SqlDataSource from the ToolBox &nbsp;</p> 2011-10-06T15:07:11-04:004628210http://forums.asp.net/p/1727688/4628210.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Eaxactly, the next step has to do with whether you need to Update, Edit, Delete the results. The controls handle all of this for you by default. Its based in the selection process when you set up the connection, look for the Advanced button. You clcik the check box to create Update, Delete, Select functionality. Your table will need to have key set and Identity specification for this to work.</p> <p>Otherwise you can and for example, a button to your web page, and use the button click event to read the data from the gridview, formview, etc, and process it as needed.</p> <p>&nbsp;</p> <p>&nbsp;</p> 2011-10-06T15:42:22-04:004628216http://forums.asp.net/p/1727688/4628216.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Ok i made it! :) but its not been added to my database i think lol.. i cant see it here this is my code<br> and i tried also with @username @password Etc..</p> <p>Didnt work :(<br> <br> </p> <pre class="prettyprint">SqlCommand sqlcmd = new SqlCommand(&quot;INSERT INTO TABLE2 (username, pass, repass, email, reemail , name , age) VALUES ('&quot; &#43; usernametb.Text &#43; &quot;,&quot; &#43; passtb.Text &#43; &quot;,&quot; &#43; rpasstb.Text &#43; &quot;,&quot; &#43; emailtb.Text &#43; &quot;,&quot; &#43; remailtb.Text &#43; &quot;,&quot; &#43; nametb.Text &#43; &quot;,&quot; &#43; agetb.Text &#43; &quot;')&quot;); sqlcmd.Parameters.AddWithValue(&quot;username&quot;, usernametb.Text); sqlcmd.Parameters.AddWithValue(&quot;password&quot;, passtb.Text); sqlcmd.Parameters.AddWithValue(&quot;repassword&quot;, rpasstb.Text); sqlcmd.Parameters.AddWithValue(&quot;email&quot;, email.Text); sqlcmd.Parameters.AddWithValue(&quot;reemail&quot;, remail.Text); sqlcmd.Parameters.AddWithValue(&quot;name&quot;, nametb.Text); sqlcmd.Parameters.AddWithValue(&quot;age&quot;, agetb.Text); Response.Redirect(&quot;~/AfterRegistreation.aspx&quot;);</pre> <p>&nbsp;</p> 2011-10-06T15:51:19-04:004628249http://forums.asp.net/p/1727688/4628249.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>You need somthing like this in your code....</p> <pre class="prettyprint">Dim command1 As New SqlCommand(sqlStmt, connection) connection.Open() command1.ExecuteNonQuery() connection.Close()</pre> <p>&nbsp;You also need to have a connection established. that is also covered in the links in my previous posts.</p> 2011-10-06T16:16:50-04:004628254http://forums.asp.net/p/1727688/4628254.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>i did made a connection with it<br> didnt work</p> 2011-10-06T16:23:15-04:004628261http://forums.asp.net/p/1727688/4628261.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Post the error.</p> <p>&nbsp;</p> <p>Also take this line of code out until you get the page working...</p> <p><span class="typ">Response</span><span class="pun">.</span><span class="typ">Redirect</span><span class="pun">(</span><span class="str">&quot;~/AfterRegistreation.aspx&quot;</span><span class="pun">);</span><span class="pln"> </span></p> 2011-10-06T16:31:22-04:004628262http://forums.asp.net/p/1727688/4628262.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>There is no error&nbsp;<br> it just doesnt get registered i tried to look a bit online and im made some changes:</p> <pre class="prettyprint">SqlConnection conn = new SqlConnection(); SqlDataAdapter da = new SqlDataAdapter(); SqlConnection sqlcon = new SqlConnection(@&quot;Data Source=TZAHI-PC\SQLEXPRESS;Initial Catalog=RegisterDb;Integrated Security=True&quot;); DataBinder ds = new DataBinder(); sqlcon.Open(); SqlCommand sqlcmd = new SqlCommand(&quot;INSERT INTO dbo.Table2 (username, pass, repass, email, reemail , name , age) VALUES ('&quot; &#43; usernametb.Text &#43; &quot;,&quot; &#43; passtb.Text &#43; &quot;,&quot; &#43; rpasstb.Text &#43; &quot;,&quot; &#43; emailtb.Text &#43; &quot;,&quot; &#43; remailtb.Text &#43; &quot;,&quot; &#43; nametb.Text &#43; &quot;,&quot; &#43; agetb.Text &#43; &quot;')&quot;); sqlcmd.Parameters.AddWithValue(&quot;username&quot;, usernametb.Text); sqlcmd.Parameters.AddWithValue(&quot;password&quot;, passtb.Text); sqlcmd.Parameters.AddWithValue(&quot;repassword&quot;, rpasstb.Text); sqlcmd.Parameters.AddWithValue(&quot;email&quot;, emailtb.Text); sqlcmd.Parameters.AddWithValue(&quot;reemail&quot;, remailtb.Text); sqlcmd.Parameters.AddWithValue(&quot;name&quot;, nametb.Text); sqlcmd.Parameters.AddWithValue(&quot;age&quot;, agetb.Text); sqlcmd.ExecuteNonQuery();</pre> <p>&nbsp;</p> 2011-10-06T16:34:46-04:004628273http://forums.asp.net/p/1727688/4628273.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Put this...</p> <p>Dim command1 As New SqlCommand(sqlcmd, sqlcon); <br> connection.Open() ;<br> command1.ExecuteNonQuery() ;<br> connection.Close();</p> <p>in place of this...</p> <p>sqlcmd.ExecuteNonQuery();</p> 2011-10-06T16:43:48-04:004628275http://forums.asp.net/p/1727688/4628275.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>by the way, are you certain that you have a connection to the data source?</p> <p>&nbsp;</p> <p>Can you query your DB and do you ahve write permissions on the database?</p> <p>&nbsp;</p> 2011-10-06T16:44:57-04:004628277http://forums.asp.net/p/1727688/4628277.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>i did it and it just says:<br> &quot;</p> <pre class="prettyprint">Error 7 The type or namespace name 'Dim' could not be found (are you missing a using directive or an assembly reference?)&quot;</pre> <p>&nbsp;</p> <pre class="prettyprint">Error 10 The name 'connection' does not exist in the current context </pre> 2011-10-06T16:47:53-04:004628278http://forums.asp.net/p/1727688/4628278.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>ohh and how can i veify that i have a writing option&gt;</p> 2011-10-06T16:49:48-04:004628291http://forums.asp.net/p/1727688/4628291.aspx/1?Re+Table+With+TextBoxesRe: Table With TextBoxes <p>Sorry I missed this in your code change this....</p> <p>connection.Open() ;<br> command1.ExecuteNonQuery() ;<br> connection.Close();</p> <p>to this....</p> <p>&nbsp;</p> <p>conn.Open() ;<br> command1.ExecuteNonQuery() ;<br> conn.Close();</p> 2011-10-06T17:04:53-04:00