Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Database
SQL Server
Insert into single column multiple textboxes from WinForm
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mathh" data-source="post: 162763" data-attributes="member: 46622"><p>Hi all,</p><p></p><p>Maybe You will find a solution - how to save (insert into statement) multiple textboxes in one column in SQL table?</p><p>Well, what I have is a winform with 20 textboxes (each is for one metric). Table is build like:</p><p></p><p>Team | GSDate | GSGroup | GSMetric | GSValue | LoggedBy</p><p></p><p>what I would like to achieve, using one buton event to save all my textboxes:</p><p></p><p>[CODE]</p><p>Team | GSDate | GSGroup | GSMetric | GSValue | LoggedBy</p><p> FR 08/21/2013 CRC Calls 100% User1</p><p> FR 08/21/2013 CRC Emails 98.7% User1</p><p> FR 08/21/2013 CRC Handled 12 User1</p><p>[/CODE]</p><p></p><p>it's a sample, but for GSMetric I would like to add all values from textboxes, and for GSValue as well, because those are changing in relation to remaining values (Team, GSDate, GSGroup, LoggedBy)</p><p></p><p>I'm using parameters.AddWithValue.</p><p></p><p>[CODE] Sql = "INSERT INTO tbl_Metrics (Team, GSDate, GSGroup, GSMetric, GSValue, LoggedBy) VALUES (@Team, @date, @group, @metric, @value, @user)" Using comm As New SqlCommand()</p><p> With comm</p><p> .Connection = cn</p><p> .CommandType = CommandType.Text</p><p> .CommandText = Sql</p><p> .Parameters.AddWithValue("@Team", gslog.cbGSTeam.SelectedItem)</p><p> .Parameters.AddWithValue("@date", MetDate.SelectedDate)</p><p> .Parameters.AddWithValue("@group", me3.Text)</p><p> .Parameters.AddWithValue("@metric", meH3.Text)</p><p> .Parameters.AddWithValue("@value", m1.Text.ToString)</p><p>[/CODE]</p><p></p><p>Thank you in advance!</p></blockquote><p></p>
[QUOTE="Mathh, post: 162763, member: 46622"] Hi all, Maybe You will find a solution - how to save (insert into statement) multiple textboxes in one column in SQL table? Well, what I have is a winform with 20 textboxes (each is for one metric). Table is build like: Team | GSDate | GSGroup | GSMetric | GSValue | LoggedBy what I would like to achieve, using one buton event to save all my textboxes: [CODE] Team | GSDate | GSGroup | GSMetric | GSValue | LoggedBy FR 08/21/2013 CRC Calls 100% User1 FR 08/21/2013 CRC Emails 98.7% User1 FR 08/21/2013 CRC Handled 12 User1 [/CODE] it's a sample, but for GSMetric I would like to add all values from textboxes, and for GSValue as well, because those are changing in relation to remaining values (Team, GSDate, GSGroup, LoggedBy) I'm using parameters.AddWithValue. [CODE] Sql = "INSERT INTO tbl_Metrics (Team, GSDate, GSGroup, GSMetric, GSValue, LoggedBy) VALUES (@Team, @date, @group, @metric, @value, @user)" Using comm As New SqlCommand() With comm .Connection = cn .CommandType = CommandType.Text .CommandText = Sql .Parameters.AddWithValue("@Team", gslog.cbGSTeam.SelectedItem) .Parameters.AddWithValue("@date", MetDate.SelectedDate) .Parameters.AddWithValue("@group", me3.Text) .Parameters.AddWithValue("@metric", meH3.Text) .Parameters.AddWithValue("@value", m1.Text.ToString) [/CODE] Thank you in advance! [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Database
SQL Server
Insert into single column multiple textboxes from WinForm
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom