Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

j1webb

@j1webb
About
Posts
26
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Select with a select
    J j1webb

    I appreciate the feedback but I had never used a Select within a Select and so not only did I not know what syntax was acceptable, I also didn't know where I could put the Selects. I have since found that I can place them almost anywhere I want. However, your example did show me a way to use a Select in a way I didn't know it could be done. That will be useful info for the future.

    Database database sales tutorial question

  • Select with a select
    J j1webb

    This is my multi word search SQL, but I also need to find the selling price of each item according to what market ID they have and then lookup their price for that market id . The first SELECT finds the Market ID which is then used by the 2nd SELECT to find the market_price. Can these 2 Select statements be placed within the large SQL in order to find the market price? If so, can someone tell me how to do it? strSQL = "Select Market_ID from CUSTOMER where ID = @CustID" strSQL = "Select * from MARKET_PRICE where PART_ID = @PartID and MARKET_ID = @MarketID" strSQL = "SELECT DISTINCT dbo.PART.ID as ID, 'strSQL = "SELECT dbo.PART.ID as ID, strSQL = strSQL & "dbo.PART.DESCRIPTION, " strSQL = strSQL & "dbo.Part.PRODUCT_CODE, " strSQL = strSQL & "UNIT_PRICE AS Price, " strSQL = strSQL & "dbo.PART.COMMODITY_CODE, " ''strSQL = strSQL & "dbo.part_model.model_number, " strSQL = strSQL & "dbo.PART.STOCK_UM " ''strSQL = strSQL & "dbo.PART_CROSSREF.CrossrefID " strSQL = strSQL & "FROM dbo.PART " strSQL = strSQL & "INNER JOIN " strSQL = strSQL & "dbo.PART_CROSSREF ON dbo.PART.ID = dbo.PART_CROSSREF.ID " strSQL = strSQL & "INNER Join " strSQL = strSQL & "dbo.PART_MODEL ON dbo.PART.PRODUCT_CODE = dbo.PART_MODEL.PRODUCT_CODE " strSQL = strSQL & " WHERE ((PART.ID like '%" & KeywordsForSearch(CountLoopsForSQL) & "%')" For CountLoopsForSQL = 0 To UBound(KeywordsForSearch) strKeyWord = KeywordsForSearch(CountLoopsForSQL) If strKeyWord <> "" Then ' Search for the words in the "ID" field strSQL = strSQL & " OR (dbo.PART_CROSSREF.crossrefID LIKE '%" & KeywordsForSearch(CountLoopsForSQL) & "%')" strSQL = strSQL & " OR (dbo.PART_CROSSREF.ID LIKE '%" & KeywordsForSearch(CountLoopsForSQL) & "%')" ' Search for the words in the "Product_code" field strSQL = strSQL & " OR (dbo.Part.Product_code LIKE '%" & KeywordsForSearch(CountLoopsForSQL) & "%')" ' Search for the words in the "Product_code" field strSQL = strSQL & " OR (dbo.Part.description LIKE '%" & KeywordsForSearch(CountLoopsForSQL) & "%')" ' Search for the words in the "Commodity_code" field strSQL = strSQL & " OR (dbo.Part.Commodity_code LIKE '%" & KeywordsForSearch(CountLoopsForSQL) & "%')" End If Next

    Database database sales tutorial question

  • Vertical spacing between ASP:labels
    J j1webb

    I am new to asp.net and my biggest problems seem to always have to do with how to make my page display look half way decent. For example: I have created 3 asp:labels so I can display a company name, address, city state zip as an address block on an aspx page. I have no problem with displaying the data, but the labels are too far apart vertically. I would like for the labels to display close to each other so they look like an address block rather than 3 disassociated lines of information. Is there a way to do this in asp.net? Thanks

    ASP.NET tutorial csharp asp-net help question

  • How to parse a string with double quotes
    J j1webb

    I really appreciate all of the help and it gave me some good ideas which I was able to apply and solve my problem. For me, the key was removing the "phrases" from the string and placing them in their own array. First I counted the number of double quotes and divided by 2. That gave me the number of "phrases" I had in the string. Then I split the string using doublequotes as the delimiter, but I did this one at a time and then removed the "phrase" from the original string, placed it in an array and then split the string again. Dim doublequote As String = Chr(34) If InStr(Keyword, doublequote) Then For i = 0 To intQuoteCount - 1 Dim arrFilename() As String arrFilename = Split(Keyword, doublequote) strRemainder0 = arrFilename(0).Trim strRemainder1 = arrFilename(1).Trim strPhrase(i) = strRemainder1 Keyword = Replace(Keyword, strRemainder1, "") strTmp = doublequote & doublequote Keyword = Replace(Keyword, strTmp, "") Next i Keyword = Replace(Keyword, doublequote, "") End If Then I split the string using " " as the delimiter. That put all of the words that were left in another array, KeywordsForSearch. Then I expanded that array by the number of elements I had in the strPhrase array and then added the elements from the strPhrase array to the KeywordsForSearch array. ' Keyword = Replace(Keyword, ",", " ") ' Just in case there are some single quotes in the search string Keyword = Replace(Keyword, "'", "''") ' In case there are double spaces in the string Keyword = Replace(Keyword, " ", " ") 'Read in the search words to be searched KeywordsForSearch = Split(Trim(Keyword), " ") Keyword = Replace(Keyword, "''", "'") Dim strKeyWord As String Dim intArrayCount As Integer = UBound(KeywordsForSearch) intArrayCount = intArrayCount + intQuoteCount ReDim Preserve KeywordsForSearch(intArrayCount) i = 0 intArrayCount = intArrayCount - 1 For i = 0 To intQuoteCount - 1 KeywordsForSearch(intArrayCount) = strPhrase(i) intArrayCount = intArrayCount + 1 Next i I'm sure this is not the most elegant solution and someone with more logical thought processes could probably clean this up considerably, but it does work. Perhaps someone else mi

    Visual Basic tutorial question

  • How to parse a string with double quotes
    J j1webb

    I'm interested in turning this type of string - blah, A&Z this "some word", another word, "Joe Jones" into "searchable" tokens, e.g. blah A&Z this some word another word Joe Jones The main delimiters would be whitespace and/or comma's, with quotes allowing for multiple words in a token. Does anyone know how this might be done? -- modified at 15:45 Tuesday 27th September, 2005

    Visual Basic tutorial question

  • ASP.Net Datagrid and thumbnails
    J j1webb

    I need to fill a datagrid with data and images. There will be some data in about 4 columns and then 1 thumbnail in one column on each row. I am reading a MS SQL DB that has the description, mfg, owner and path/name to the jpg image for that item. What I need to do is convert the images to thumbnails, store them in a dataset along with the other data that will be displayed in the datagrid and then bind the DS to a datagrid. Does anyone know if this can be done. If so, can you either tell me how to do it or direct me to some info that will help me. If it can't be done this way, does anyone know how it can be done and would you share that with me.

    ASP.NET database csharp asp-net help tutorial

  • Borrowing code&#8230;
    J j1webb

    I look at it this way, a code snippet is a far cry from an entire application. If you were to say something very clever and someone else used that in a book (on which they made money) or in a speech (on which they made no money) what would you do? First of all you should feel very good about yourself because someone used your line. One of the worst things that can happen to a person is to have lived an entire lifetime and to have never been quoted. After that you don't have much recourse. No court is going to award you anything just because someone used one of your lines (or even 3 or 4) in a book. Musicians have a similar situation. They are always teaching each other a new riff or chord progression. Sometimes that riff or chord progession will be used in a hit song, but that doesn't mean the originator is going to get anything from it. The only situation that is different is in song and screen writing. If a person is writing a song and someone suggests a phrase or two, then quite often that person will get a credit in the copyright and will make money from it. In screen writing, if you are hired to be a screen writer, you write or even rewrite a few lines and then are fired, you still get a screenwriting credit (you may not get anymore money, but you get the credit). So, like I said, I think it depends on whether it is a code snippet or an entire application. BTW, concerning personal property, around here if I have an old couch, appliance, computer, etc. and I want to get rid of it. I just place it on the curb in front of my house. It will be gone in no time. I don't have to put a sign on it saying "Free, you can take it", I just have to make it available "on the curb", not on the drive or next to my house. So I think it also depends on how or where you make it available.

    The Lounge csharp visual-studio com question discussion

  • Messageboard Etiquette
    J j1webb

    I still believe people can become socially acceptable if given the proper guidance and opportunity. I was in the Infantry for 33 years (3 tours in Vietnam and 1 in Desert Storm) and was both a Platoon Sgt and a 1st Sgt. I also coached both youth baseball and American Legion baseball for over 18 years. I've trained hundreds of young men and have had my successes and failures, but the one thing I discovered was that many of these young men not only lacked the understanding of courtesy they were never given much of it themselves. It is not taught much anymore in either the home or schools. So it was always a priority for both my troops and my players to practice it and I felt like it made a difference because often it was the only structure they had in their lives. I have 3 daughters and 1 son who also work with youth. One daughter is a teacher for disturbed children, 2 daughters are youth ministers and my son is an English teacher and a high school coach. All 4 of them stress teaching courtesy and general social interaction. Thay also have discovered neither parents nor teachers seem to feel this is important. But it has made a tremendous positive impact in many of lives of the children they work with. But courtesy is like respect, you have to give it before you can receive it. So if you give up and say, "Nothing is going to change", then it won't. I have refused to give up and I continue to win my little victories from time to time.

    The Lounge help question

  • Messageboard Etiquette
    J j1webb

    You are correct to a point. But if newbies aren't aware that there is some etiquette involved in using the messageboards they will never use it. It's like No Shirt, No Shoes, No Service. I realize some people will still try to ignore that rule, but most people will adhere to it once they know certain establishments require it. But, thanks for your opinion.

    The Lounge help question

  • Messageboard Etiquette
    J j1webb

    Actually I thought I would first see what others thought about it and if enough people responded and agreed then I intended to make the suggestion. I didn't just say "Gee, why doesn't Code Project do this", I was asking for opinions, that's why I asked what others thought. That way I could present more than just my opinion and I would know if it should be pursued. I like to do a little homework before making suggestions.

    The Lounge help question

  • Im trying to return a datatable when using OleDbCommand
    J j1webb

    You might also want to download this project and look at it. It has a class that might do what you are looking for. http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=352&lngWId=10\\

    Visual Basic database question

  • Im trying to return a datatable when using OleDbCommand
    J j1webb

    You might also want to download this project and look at it. It has a class that might do what you are looking for. http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=352&lngWId=10\\

    Visual Basic database question

  • Messageboard Etiquette
    J j1webb

    It might be nice is there were some Messageboard Etiquette suggestions visibly posted somewhere so the newbies (and even the oldies) might learn some of the basic rules. Like responding back (possibly with a Thank You)if the help that was posted worked, or not bluntly saying "Need code to do this or that, immediately", or something similar. Does anyone else think this would be worthwhile?

    The Lounge help question

  • Im trying to return a datatable when using OleDbCommand
    J j1webb

    You can try this code to use your datareader to build your datatable Dim table As New DataTable() Dim row As DataRow Dim rows As DataRowCollection ' read table schema from datareader rows = DataReader.GetSchemaTable.Rows 'If you already know your field names you can use this table.Clear() table.Columns.Clear() ' Define the columns. table.Columns.Add("Last Name", GetType(String)) table.Columns.Add("First Name", GetType(String)) table.Columns.Add("Phone Number", GetType(String)) table.Columns.Add("Email Address", GetType(String)) 'Other wise do this ' use schema to create the columns for the new datatable For Each row In rows Dim col As New DataColumn() col.ColumnName = row("ColumnName").ToString col.Unique = System.Convert.ToBoolean(row("IsUnique")) col.AllowDBNull = System.Convert.ToBoolean(row("AllowDBNull")) col.ReadOnly = System.Convert.ToBoolean(row("IsReadOnly")) col.DataType = Type.GetType(row("DataType").ToString) table.Columns.Add(col) Next While DataReader.Read row = table.NewRow Dim col As DataColumn For Each col In table.Columns row(col) = DataReader(col.ColumnName) Next table.Rows.Add(row) End While Return table Please let me know if this helped you.

    Visual Basic database question

  • Formatting numbers in a datagrid
    J j1webb

    Thank you for your response. I had already been trying to use the .format member but with the way I was coding the columns it would not work. I would get an error telling me it was not a member of that object. I finally tried a different way of coding for the columns (similar to yours) but I had to make other additional changes and I finally got it to work. I appreciate your help. You made me rethink how I was approaching the column coding.

    Visual Basic help tutorial question

  • Formatting numbers in a datagrid
    J j1webb

    This seems like it should be simple but I could not find any info anywhere to tell me how to do it. Below is the code I am using in my datagrid and I need to format the number in this cell with ",". When 123456789 is displayed (not entered) it needs to look like this 123,456,789 .Add(New System.Windows.Forms.DataGridTextBoxColumn) With .Item(3) .MappingName = "DriveSize" .HeaderText = "Drive Size" .Width = 115 .NullText = String.Empty End With If I try to put the .format member is the above code I get an error telling me it is not a member the datagrid columns style. I have used the .format before to format money, but I don't know why it won't work here. Can anyone tell me what I need to do to format this cell?

    Visual Basic help tutorial question

  • ActiveX in C++
    J j1webb

    I wrote some MSDOS programs in C++ many years ago (Borland's C++) and so I'm not very knowledgeable about the current Visual C++, but here is what I want to do and it doesn't seem like it should be too difficult. I have a web site that displays a table of records and each line has a microphone icon on it. When the user clicks on that mic icon another web page is opened and it tells the user they may create a dictation. (We have special dictation mics running from a vb.net app that runs from the user's local machine.) We also have an image display program running at the same time and it also runs from the user's machine. The web app knows what the StudyID is but the vb.net apps don't and I need to be able to pass that StudyID to the local machine so it can be used by the image display program to find the correct images to display while the user is dictating. I wrote a "faux" activeX (dll) in vb.net that could be placed on the web site and run when the 2nd page is displayed and the studyID could be passed to it and then it would use the study ID and the Process class to cause the image display program to display the correct images, but that would require each user's machine to have the correct security manually setup in .Net Configuration and we don't want to have to do that. So I thought maybe an ActiveX written in C++ could basically do the same thing. Does this make sense? Could this be done and if so, would it be as easily done as I think it might be.

    C / C++ / MFC c++ workspace csharp delphi

  • How Do I
    J j1webb

    I can't guarantee all of this code because I pulled it out of one of my programs and then edited it down to what I thought you could use, but I did not test it. Private Sub loadDatagrid() boolBeenToGatagrid = True AddRecords() strImportfolder = aPath 'this is the folder in which the file resides strFilename = "selectdata.csv" 'this is the csv file to be imported strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + strImportfolder + ";Extensions=asc,csv,tab,txt;Persist Security Info=False;" Conn = New System.Data.Odbc.OdbcConnection(strConnstr) da = New System.data.Odbc.OdbcDataAdapter("select * from [" + strFilename + "]", Conn) Try ds2.Clear() da.Fill(ds2, "TableName") Catch esc As Exception System.Windows.Forms.MessageBox.Show(esc.Message, "") End Try With DataGrid1 .SetDataBinding(ds2, "TableName") ' Set DataGrid Background Color .GridLineColor = System.Drawing.Color.Black .BackgroundColor = System.Drawing.Color.Lavender ' Set DataGrid Caption Background Color .CaptionBackColor = System.Drawing.Color.SlateBlue ' Set DataGrid Caption Foreground Color .CaptionForeColor = System.Drawing.Color.White 'LemonChiffon ' Set DataGrid Parent Rows Background Color .ParentRowsBackColor = System.Drawing.Color.Lavender ' Set DataGrid Parent Rows Foreground Color .ParentRowsForeColor = System.Drawing.Color.SlateBlue ' Set DataGrid Caption Text .CaptionText = "Study List" ' Clear DataGrid Table Styles .TableStyles.Clear() End With ' Set data grid Table Style Dim tblCrrncMngr As System.Windows.Forms.CurrencyManager = CType(BindingContext(ds2.Tables.Item("TableName")), System.Windows.Forms.CurrencyManager) Dim TblStyle As New System.Windows.Forms.DataGridTableStyle With TblStyle .MappingName = "TableName" ''''''.MappingName = "Studies" .BackColor = System.Drawing.Color.White .ForeColor = System.Drawing.Color.Black 'DarkSlateBlue .GridLineColor = System.Drawing.Color.Black 'MediumSlateBlue .HeaderBackColor = System.Drawing.Color.Lavender .HeaderForeColor = System.Drawing.Color.DarkBlue 'MediumSlateBlue .

    Database question

  • reading a .txt file for data in VB .NET
    J j1webb

    I'm not sure i understand 100% what you are wanting to do, but if you want to read .txt (.csv, etc) file and place the data in a data grid, this is one way to do it. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim data_table As New DataTable("Contacts") ' Define the columns. data_table.Columns.Add("Last Name", GetType(String)) data_table.Columns.Add("First Name", GetType(String)) data_table.Columns.Add("Phone Number", GetType(String)) data_table.Columns.Add("Email Address", GetType(String)) ' Create some data. AddTableRow(data_table, "Jackson", "Jennie", "787-878-8263", "JennieJackson@nowhere.com") AddTableRow(data_table, "Kevlar", "Kurt", "872-348-7263", "kurtk@militant.com") AddTableRow(data_table, "Llama", "Linda", "", "lllama@weaver.com") AddTableRow(data_table, "Mandrake", "Marcus", "398-787-4764", "marcus@marcusrocks.com") ' Bind the DataTable to the DataGrid. dgContacts.DataSource = data_table End Sub Private Sub AddTableRow(ByVal data_table As DataTable, ByVal last_name As String, ByVal first_name As String, ByVal phone_number As String, ByVal email_address As String) Dim data_row As DataRow data_row = data_table.NewRow() data_row.Item("Last Name") = last_name data_row.Item("First Name") = first_name data_row.Item("Phone Number") = phone_number data_row.Item("Email Address") = email_address data_table.Rows.Add(data_row) End Sub If you are using a datagrid you have to give it some fieldname info and that is what the first section (Define the columns) is for. If this isn't what you are looking for, then there is a way you can use a SQL Text Driver and process your .txt file with an SQL table. Let me know if you think that would work better and I will show you that code.

    Visual Basic csharp tutorial

  • Sending messages from one app to another app
    J j1webb

    I have an application where I first load a vb.net app that is going to run in the background. That app then starts another vb.net app that is the user interface (UI). Is there anyway I can send a message (or something) from my UI app to my background app so it can then start a process? If so, how would that be done?

    Visual Basic design csharp question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups