how to retrieve data from autocomplete textbox












0















I am working on a stock management system and i added textbox with autocomplete codes..i have two forms one is items form and other is stock in. now i can able to get itemcodeID from stockin itemnumber textbox with autocomplete codes but when i select that item number its not giving me the description..i mean to say that if user search itemcode in stock in form then he should get description and quantity of that item automatically... i am using vb.net and ms sql .



my code for autocomplete



Private Sub getData(ByVal dataCollection As AutoCompleteStringCollection)
Dim connetionString As String = Nothing
Dim connection As SqlConnection
Dim command As SqlCommand
Dim adapter As New SqlDataAdapter()
Dim ds As New DataSet()

connetionString = ("Server= DESKTOP-QN6F623; Database = dbo_main;Integrated Security = false;User ID=dis;Password=0m3rP@ss")
Dim sql As String = "SELECT itemnumber FROM items"
connection = New SqlConnection(connetionString)
Try
connection.Open()
command = New SqlCommand(sql, connection)
adapter.SelectCommand = command
adapter.Fill(ds)
adapter.Dispose()
command.Dispose()
connection.Close()
For Each row As DataRow In ds.Tables(0).Rows
dataCollection.Add(row(0).ToString())
Next
Catch ex As Exception
MessageBox.Show("Can not open connection ! ")
End Try
End Sub

Private Sub stockin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Stockin_itemnumberTextBox.AutoCompleteMode = AutoCompleteMode.Suggest
Stockin_itemnumberTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource
Dim DataCollection As New AutoCompleteStringCollection()
getData(DataCollection)
Stockin_itemnumberTextBox.AutoCompleteCustomSource = DataCollection
End Sub


i need....when user write in itemnumber textbox he should get related details automatically related to that number...itemnumber of textbox is autocomplete .










share|improve this question

























  • "Automatically" from the user's perspective means that you write code to make it happen. Where have you written any code to retrieve description or quantity values from the database or display them based on the user's selection? You haven't written any such code, so of course it doesn't happen. You need to make an attempt before posting a question here. This is not a place that we explain how to do things. It's a place where we help you fix issues with code you have written. If you haven't written any code, you have no issue to fix.

    – jmcilhinney
    Jan 1 at 4:06











  • my friend i posted code as my attempt. i saw many questions where peoples got answers with explanations thats why i post my question here. no one is perfect and everyone need help to achieve goals . i only need help in my above mentioned code or if anyone give me a code or idea to do as per my requirement. try to help instead of getting rude bro.happy new year

    – omi4u
    Jan 1 at 5:24













  • The code you posted has got nothing to do with your stated aim. It retrieves specific data and uses that data in an autocomplete list on a Textbox. The code you have is, as far as I can tell, working as it should. You said you wanted to do something else apart from that and you have shown no code that has anything to do with that other thing. If you've made no attempt to do the thing that you want help doing then it's to early to post a question on that. It's not rude to inform you that you are doing the wrong thing. If you don't want to be criticised, don't do the wrong thing.

    – jmcilhinney
    Jan 1 at 6:09
















0















I am working on a stock management system and i added textbox with autocomplete codes..i have two forms one is items form and other is stock in. now i can able to get itemcodeID from stockin itemnumber textbox with autocomplete codes but when i select that item number its not giving me the description..i mean to say that if user search itemcode in stock in form then he should get description and quantity of that item automatically... i am using vb.net and ms sql .



my code for autocomplete



Private Sub getData(ByVal dataCollection As AutoCompleteStringCollection)
Dim connetionString As String = Nothing
Dim connection As SqlConnection
Dim command As SqlCommand
Dim adapter As New SqlDataAdapter()
Dim ds As New DataSet()

connetionString = ("Server= DESKTOP-QN6F623; Database = dbo_main;Integrated Security = false;User ID=dis;Password=0m3rP@ss")
Dim sql As String = "SELECT itemnumber FROM items"
connection = New SqlConnection(connetionString)
Try
connection.Open()
command = New SqlCommand(sql, connection)
adapter.SelectCommand = command
adapter.Fill(ds)
adapter.Dispose()
command.Dispose()
connection.Close()
For Each row As DataRow In ds.Tables(0).Rows
dataCollection.Add(row(0).ToString())
Next
Catch ex As Exception
MessageBox.Show("Can not open connection ! ")
End Try
End Sub

Private Sub stockin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Stockin_itemnumberTextBox.AutoCompleteMode = AutoCompleteMode.Suggest
Stockin_itemnumberTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource
Dim DataCollection As New AutoCompleteStringCollection()
getData(DataCollection)
Stockin_itemnumberTextBox.AutoCompleteCustomSource = DataCollection
End Sub


i need....when user write in itemnumber textbox he should get related details automatically related to that number...itemnumber of textbox is autocomplete .










share|improve this question

























  • "Automatically" from the user's perspective means that you write code to make it happen. Where have you written any code to retrieve description or quantity values from the database or display them based on the user's selection? You haven't written any such code, so of course it doesn't happen. You need to make an attempt before posting a question here. This is not a place that we explain how to do things. It's a place where we help you fix issues with code you have written. If you haven't written any code, you have no issue to fix.

    – jmcilhinney
    Jan 1 at 4:06











  • my friend i posted code as my attempt. i saw many questions where peoples got answers with explanations thats why i post my question here. no one is perfect and everyone need help to achieve goals . i only need help in my above mentioned code or if anyone give me a code or idea to do as per my requirement. try to help instead of getting rude bro.happy new year

    – omi4u
    Jan 1 at 5:24













  • The code you posted has got nothing to do with your stated aim. It retrieves specific data and uses that data in an autocomplete list on a Textbox. The code you have is, as far as I can tell, working as it should. You said you wanted to do something else apart from that and you have shown no code that has anything to do with that other thing. If you've made no attempt to do the thing that you want help doing then it's to early to post a question on that. It's not rude to inform you that you are doing the wrong thing. If you don't want to be criticised, don't do the wrong thing.

    – jmcilhinney
    Jan 1 at 6:09














0












0








0








I am working on a stock management system and i added textbox with autocomplete codes..i have two forms one is items form and other is stock in. now i can able to get itemcodeID from stockin itemnumber textbox with autocomplete codes but when i select that item number its not giving me the description..i mean to say that if user search itemcode in stock in form then he should get description and quantity of that item automatically... i am using vb.net and ms sql .



my code for autocomplete



Private Sub getData(ByVal dataCollection As AutoCompleteStringCollection)
Dim connetionString As String = Nothing
Dim connection As SqlConnection
Dim command As SqlCommand
Dim adapter As New SqlDataAdapter()
Dim ds As New DataSet()

connetionString = ("Server= DESKTOP-QN6F623; Database = dbo_main;Integrated Security = false;User ID=dis;Password=0m3rP@ss")
Dim sql As String = "SELECT itemnumber FROM items"
connection = New SqlConnection(connetionString)
Try
connection.Open()
command = New SqlCommand(sql, connection)
adapter.SelectCommand = command
adapter.Fill(ds)
adapter.Dispose()
command.Dispose()
connection.Close()
For Each row As DataRow In ds.Tables(0).Rows
dataCollection.Add(row(0).ToString())
Next
Catch ex As Exception
MessageBox.Show("Can not open connection ! ")
End Try
End Sub

Private Sub stockin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Stockin_itemnumberTextBox.AutoCompleteMode = AutoCompleteMode.Suggest
Stockin_itemnumberTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource
Dim DataCollection As New AutoCompleteStringCollection()
getData(DataCollection)
Stockin_itemnumberTextBox.AutoCompleteCustomSource = DataCollection
End Sub


i need....when user write in itemnumber textbox he should get related details automatically related to that number...itemnumber of textbox is autocomplete .










share|improve this question
















I am working on a stock management system and i added textbox with autocomplete codes..i have two forms one is items form and other is stock in. now i can able to get itemcodeID from stockin itemnumber textbox with autocomplete codes but when i select that item number its not giving me the description..i mean to say that if user search itemcode in stock in form then he should get description and quantity of that item automatically... i am using vb.net and ms sql .



my code for autocomplete



Private Sub getData(ByVal dataCollection As AutoCompleteStringCollection)
Dim connetionString As String = Nothing
Dim connection As SqlConnection
Dim command As SqlCommand
Dim adapter As New SqlDataAdapter()
Dim ds As New DataSet()

connetionString = ("Server= DESKTOP-QN6F623; Database = dbo_main;Integrated Security = false;User ID=dis;Password=0m3rP@ss")
Dim sql As String = "SELECT itemnumber FROM items"
connection = New SqlConnection(connetionString)
Try
connection.Open()
command = New SqlCommand(sql, connection)
adapter.SelectCommand = command
adapter.Fill(ds)
adapter.Dispose()
command.Dispose()
connection.Close()
For Each row As DataRow In ds.Tables(0).Rows
dataCollection.Add(row(0).ToString())
Next
Catch ex As Exception
MessageBox.Show("Can not open connection ! ")
End Try
End Sub

Private Sub stockin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Stockin_itemnumberTextBox.AutoCompleteMode = AutoCompleteMode.Suggest
Stockin_itemnumberTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource
Dim DataCollection As New AutoCompleteStringCollection()
getData(DataCollection)
Stockin_itemnumberTextBox.AutoCompleteCustomSource = DataCollection
End Sub


i need....when user write in itemnumber textbox he should get related details automatically related to that number...itemnumber of textbox is autocomplete .







sql vb.net






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 4:03









jmcilhinney

25.7k22032




25.7k22032










asked Dec 31 '18 at 9:29









omi4uomi4u

62




62













  • "Automatically" from the user's perspective means that you write code to make it happen. Where have you written any code to retrieve description or quantity values from the database or display them based on the user's selection? You haven't written any such code, so of course it doesn't happen. You need to make an attempt before posting a question here. This is not a place that we explain how to do things. It's a place where we help you fix issues with code you have written. If you haven't written any code, you have no issue to fix.

    – jmcilhinney
    Jan 1 at 4:06











  • my friend i posted code as my attempt. i saw many questions where peoples got answers with explanations thats why i post my question here. no one is perfect and everyone need help to achieve goals . i only need help in my above mentioned code or if anyone give me a code or idea to do as per my requirement. try to help instead of getting rude bro.happy new year

    – omi4u
    Jan 1 at 5:24













  • The code you posted has got nothing to do with your stated aim. It retrieves specific data and uses that data in an autocomplete list on a Textbox. The code you have is, as far as I can tell, working as it should. You said you wanted to do something else apart from that and you have shown no code that has anything to do with that other thing. If you've made no attempt to do the thing that you want help doing then it's to early to post a question on that. It's not rude to inform you that you are doing the wrong thing. If you don't want to be criticised, don't do the wrong thing.

    – jmcilhinney
    Jan 1 at 6:09



















  • "Automatically" from the user's perspective means that you write code to make it happen. Where have you written any code to retrieve description or quantity values from the database or display them based on the user's selection? You haven't written any such code, so of course it doesn't happen. You need to make an attempt before posting a question here. This is not a place that we explain how to do things. It's a place where we help you fix issues with code you have written. If you haven't written any code, you have no issue to fix.

    – jmcilhinney
    Jan 1 at 4:06











  • my friend i posted code as my attempt. i saw many questions where peoples got answers with explanations thats why i post my question here. no one is perfect and everyone need help to achieve goals . i only need help in my above mentioned code or if anyone give me a code or idea to do as per my requirement. try to help instead of getting rude bro.happy new year

    – omi4u
    Jan 1 at 5:24













  • The code you posted has got nothing to do with your stated aim. It retrieves specific data and uses that data in an autocomplete list on a Textbox. The code you have is, as far as I can tell, working as it should. You said you wanted to do something else apart from that and you have shown no code that has anything to do with that other thing. If you've made no attempt to do the thing that you want help doing then it's to early to post a question on that. It's not rude to inform you that you are doing the wrong thing. If you don't want to be criticised, don't do the wrong thing.

    – jmcilhinney
    Jan 1 at 6:09

















"Automatically" from the user's perspective means that you write code to make it happen. Where have you written any code to retrieve description or quantity values from the database or display them based on the user's selection? You haven't written any such code, so of course it doesn't happen. You need to make an attempt before posting a question here. This is not a place that we explain how to do things. It's a place where we help you fix issues with code you have written. If you haven't written any code, you have no issue to fix.

– jmcilhinney
Jan 1 at 4:06





"Automatically" from the user's perspective means that you write code to make it happen. Where have you written any code to retrieve description or quantity values from the database or display them based on the user's selection? You haven't written any such code, so of course it doesn't happen. You need to make an attempt before posting a question here. This is not a place that we explain how to do things. It's a place where we help you fix issues with code you have written. If you haven't written any code, you have no issue to fix.

– jmcilhinney
Jan 1 at 4:06













my friend i posted code as my attempt. i saw many questions where peoples got answers with explanations thats why i post my question here. no one is perfect and everyone need help to achieve goals . i only need help in my above mentioned code or if anyone give me a code or idea to do as per my requirement. try to help instead of getting rude bro.happy new year

– omi4u
Jan 1 at 5:24







my friend i posted code as my attempt. i saw many questions where peoples got answers with explanations thats why i post my question here. no one is perfect and everyone need help to achieve goals . i only need help in my above mentioned code or if anyone give me a code or idea to do as per my requirement. try to help instead of getting rude bro.happy new year

– omi4u
Jan 1 at 5:24















The code you posted has got nothing to do with your stated aim. It retrieves specific data and uses that data in an autocomplete list on a Textbox. The code you have is, as far as I can tell, working as it should. You said you wanted to do something else apart from that and you have shown no code that has anything to do with that other thing. If you've made no attempt to do the thing that you want help doing then it's to early to post a question on that. It's not rude to inform you that you are doing the wrong thing. If you don't want to be criticised, don't do the wrong thing.

– jmcilhinney
Jan 1 at 6:09





The code you posted has got nothing to do with your stated aim. It retrieves specific data and uses that data in an autocomplete list on a Textbox. The code you have is, as far as I can tell, working as it should. You said you wanted to do something else apart from that and you have shown no code that has anything to do with that other thing. If you've made no attempt to do the thing that you want help doing then it's to early to post a question on that. It's not rude to inform you that you are doing the wrong thing. If you don't want to be criticised, don't do the wrong thing.

– jmcilhinney
Jan 1 at 6:09












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53985790%2fhow-to-retrieve-data-from-autocomplete-textbox%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53985790%2fhow-to-retrieve-data-from-autocomplete-textbox%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas